Sending commands via WWW

Marcin Wasilewski marcinwasilewski at poczta.onet.pl
Fri Apr 29 14:07:59 CEST 2005


Hello,

I'm using Nagios for about 2 years and it very good.
From time to time I have an idea to use it to something new and I wonder 
about something like that:

I have created passive service:
define service{
#       use                     generic-service         ; Name of service 
template to use
        host_name                       Backup_host
        service_description             change_tape
        is_volatile                     1
        active_checks_enabled           0
        passive_checks_enabled          1
        max_check_attempts              1
        check_period                    24x7
        contact_groups                  admins
        notification_interval           15
        notification_period             24x7
        notification_options            w,u,c,r
        normal_check_interval           480
        retry_check_interval            540
        check_command                   check_none
        }

and I use such cron script:
01 09 * * * /etc/nagios/skrypty/tapes


#!/bin/bash
DZIEN=`date +%u`

if [ "$DZIEN" == "5" ]
then
echo "[`date +%s`] 
PROCESS_SERVICE_CHECK_RESULT;Backup_host;change_tape;1;\"Change tapes: 
TAPE1, TAPE2\"" >> /var/log/nagios/rw/nagios.cmd
fi

# Last wednesday of month
[ $(date -d '+ 1 week' +%-m) -ne $(date +%-m) ] && \
[ $(date +%A) == "środa" ] && echo "[`date +%s`] 
PROCESS_SERVICE_CHECK_RESULT;Backup_host;change_tape;1;\"Change tapes: 
TAPE4, TAPE5\"" >> /var/log/nagios/rw/nagios.cmd


It works and it's fine :)

Now I would like to disable this warning after changing the tapes. I could 
do this by executing another shell script but it is not the way it should 
be.
I'm looking for some ideas/suggestions/help on executing it from Nagios' 
WWW - maybe by creating button/link  on the page and executing cmd.cgi or 
extinfo.cgi?
If it is a good idea please help me create the proper command.

Best regards
Marcin



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id5hix
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
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





More information about the Users mailing list