Sending commands via WWW

Frederik Vanhee frederik.vanhee at perso.be
Fri Apr 29 14:20:26 CEST 2005


Hello Marcin,

I'm doing about the same thing. I have written a plugin that checks if 
the backup runs fine and when the day arrives to change the tapes, the 
plugin outputs a warning (exit 1) and the message : 'please change the 
tapes'.

I don't know how sophisticated your backup software is, but I'm using 
Legato Networker and I can ask for the name of the tapes in the jukebox. 
And then I can compare these names with the tapes that are needed. So my 
message 'please change the tapes' disappears automatically, on the 
condition that you run the plugin more than once a day of course, for 
example once an hour.

Frederik


Marcin Wasilewski wrote:

>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
>
>  
>



-------------------------------------------------------
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