Having a remote server tell Nagios it is going intoscheduled maintenance

Marc Powell marc at ena.com
Sat Nov 17 17:20:47 CET 2007



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of
Jim.Melin at co.hennepin.mn.us
> Sent: Friday, November 16, 2007 3:50 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Having a remote server tell Nagios it is going
> intoscheduled maintenance
> 
> 
> Greetings everyone.
> 
> Is there a way for a server, let's say it's going into single user
mode
> for a backup, to tell nagios that it's going into scheduled downtime
and
> have
> nagios do the necessary bits?

Possible: yes, easy to do: perhaps not.

Essentially, you want your remote server to be able to issue an external
command to nagios notifying it of the downtime. I'm sure there are many
ways that you can initiate a communication between the two machine but
there are three ways that I can think to do that fairly easily --
	1) use wget, LWP POST or other command line web tool to craft a
properly formatted post to pass the information below to
http://www.yournagios.com/nagios/cgi/cmd.cgi as a shutdown script --

	cmd_type - 55
	cmd_mod - 2
	host - <remote hostname>
	com_author - <comment author>
	com_data - <comment text> 
	trigger - (0|1)
	start_time - <example 11-17-2007 10:06:00>
	end_time - <example 11-17-2007 12:06:00>
	fixed - (0|1)
	hours - <number of hours>
	minutes - <number of minutes>
	childoptions - <Do nothing with child hosts|Schedule triggered
downtime for all child hosts|Schedule non-triggered downtime for all
child hosts>

I obtained the above parameters by viewing the scheduled downtime gui
page with firefox, then right click, view page info, forms tab.

	2) use passwordless ssh from your remote box to run a script on
your nagios box that submits the SCHEDULE_HOST_DOWNTIME external command
directly to the external command file 
	
http://www.nagios.org/developerinfo/externalcommands/commandinfo.php?com
mand_id=118
	3) create your own cgi that does the above that you call instead
of cmd.cgi.

-
Marc

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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