Hi,
I'm trying to restart windows services and to send notifications in the same
time, thanks to the check_nrpe command.
here is my service:

define service{
        host_name                       Server
        service_description             Server Sql
        is_volatile                     0
        check_period                    always
        max_check_attempts              1
        normal_check_interval           20
        retry_check_interval            0
        contact_groups                  Admin
        notification_interval           0
        notification_period             always
        notification_options            c,r
        event_handler                   restart_mssql
        check_command                   check_nt_process! SQLSERVR.EXE

And here is my check_command:

define command{
        command_name    restart_mssql
        command_line    /usr/bin/printf "%b"
"$NOTIFICATIONTYPE$:$SERVICEDESC$=$SERVICESTATE$ on $HOSTALIAS$ " |
/usr/bin/mail -s "$SERVICEDESC$=$SERVICESTATE$ on $HOSTALIAS$" $CONTACTEMAIL$
\&& $USER1$/check_nrpe -H $HOSTADDRESS$ -c restart_mssql
        }

This works very well, but what I want is to use this kind of check_command in
order to restart any service.

Here is the check_command:

define command{
        command_name    restart_service
        command_line    /usr/bin/printf "%b"
"$NOTIFICATIONTYPE$:$SERVICEDESC$=$SERVICESTATE$ on $HOSTALIAS$" |
/usr/bin/mail -s "$SERVICEDESC$=$SERVICESTATE$ on $HOSTALIAS$" $CONTACTEMAIL$
\&& $USER1$/check_nrpe -H $HOSTADDRESS$ -c restart_service -a $ARG1$
        }

But this command requires an argument... Is it possible to specify one with
event_handler ?
Is there an other method for doing what I want ?
Or Do I have to create one command for one service ?
Thanks


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to