Friday, September 3rd 2010, 11:11am UTC+2
You are not logged in.
Beginner
Birthday: Oct 28th 1983 (26)
Gender: male
Location: Berlin
Occupation: Fachinformatiker Systemintegration
Number of Nagios server: 2
Nagios Versions: 3.0rc1
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: ~30
Number of services: ~160
OS: CentOS 5
Plugin Versions: 1.4.10
Other Addons: PNP, dokuWiKi
habe ich mir eine Erleichterung des ganzen gemacht und würde die gerne mit euch teilen.|
|
Source code |
1 2 3 4 |
define command{
command_name do_event
command_line /usr/local/nagios/libexec/event/run_command $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $HOSTADDRESS$ $ARG1$
}
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
#!/bin/sh case "$1" in OK) ;; WARNING) ;; UNKNOWN) ;; CRITICAL) case "$2" in SOFT) case "$3" in 3) echo -n "Restarting Service (3rd soft critical state)..." /usr/local/nagios/libexec/check_nrpe -H "$4" -c "$5" ;; esac ;; HARD) echo -n "Restarting Service..." /usr/local/nagios/libexec/check_nrpe -H "$4" -c "$5" ;; esac ;; esac exit 0 |
|
|
Source code |
1 |
event_handler do_event!restart_httpd |
|
|
Source code |
1 |
command[restart_httpd]=sudo /etc/init.d/httpd restart |

This post has been edited 1 times, last edit by "RomanK" (Oct 19th 2007, 2:26pm)

|
|
Source code |
1 2 3 |
[1195724314] SERVICE ALERT: bvs-web01;Apache1;CRITICAL;SOFT;1;apache2: Stopped [1195724314] SERVICE EVENT HANDLER: bvs-web01;Apache1;(null);(null);(null);do_event!start_apache [1195724314] Warning: Attempting to execute the command "/usr/local/nagios/libexec/event/run_command CRITICAL SOFT 1 10.40.2.4 start_apache" resulted in a return code of 126. Make sure the script or binary you are trying to execute actually exists... |
|
|
Source code |
1 2 3 4 5 6 7 8 |
define service{
use generic-service
host_name bvs-web01
service_description Apache1
check_command check_nt!SERVICESTATE!-d SHOWALL -l apache2
event_handler do_event!start_apache
notification_options w,c,r
}
|
|
|
Source code |
1 |
command[start_apache]=C:\NSClient++\nrpe\bin\apache.bat |
This post has been edited 2 times, last edit by "raheem" (Nov 22nd 2007, 10:55am)
|
|
Source code |
1 |
ls -la /usr/local/nagios/libexec/event/run_command |
|
|
Source code |
1 |
-rwxr-xr-x 1 nagios nagios 411 Nov 22 10:10 /usr/local/nagios/libexec/event/run_command |
This post has been edited 1 times, last edit by "raheem" (Nov 22nd 2007, 1:23pm)
Beginner
Birthday: Oct 28th 1983 (26)
Gender: male
Location: Berlin
Occupation: Fachinformatiker Systemintegration
Number of Nagios server: 2
Nagios Versions: 3.0rc1
Distributed monitoring: Nein
Redundant monitoring: Nein
Number of hosts: ~30
Number of services: ~160
OS: CentOS 5
Plugin Versions: 1.4.10
Other Addons: PNP, dokuWiKi
|
|
Source code |
1 |
/usr/local/nagios/libexec/event/run_command CRITICAL SOFT 1 10.40.2.4 start_apache |
|
|
Source code |
1 |
-bash: /usr/local/nagios/libexec/event/run_command: /bin/sh^M: bad interpreter: Datei oder Verzeichnis nicht gefunden |
This post has been edited 3 times, last edit by "raheem" (Nov 26th 2007, 10:53am)