RES: [Nagios-users]

Marcio Queiroz marcioqueiroz at vicom.com.br
Fri Jul 11 17:21:42 CEST 2003


Andrew, i would do this :

	# 'restart-spooler'  command definition
	define command{
	command_name	restart-spooler
	command_line
/usr/local/nagios/libexec/eventhandlers/restart-spooler.sh $HOSTADDRESS$
$SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$

		}

 in the script :


	rsh $1 net start \"Spooler\"


[]s

	Marcio Q.  Dall Agnol
	phone : 55-21-3873-5826
	Fax      : 55-21-3873-5845
	marcioqueiroz at vicom.com.br
	VICOM
	Net Serviços de Comunicação S/A
	Visite nossas páginas:
	Redes Corporativas: <http://www.vicom.com.br>
	Internet Banda Larga: <http://www.virtua.com.br>
	TV por Assinatura : <http://www.net.tv.br>
	Institucional: http://www.netservicos.com



> ----- Mensagem original -----
> De:		Sanderson, Andrew [SMTP:Andrew.Sanderson at ahsys.org]
> Enviada em:		sexta-feira, 11 de julho de 2003 11:48
> Para:		Rob Nelson; nagios-users at lists.sourceforge.net
> Assunto:		RE: [Nagios-users] [Nagios-users]
> 
> Thanks for your help
> 
> I can make the script work if I hardcode the servername or ip address.
> 
> My check command for the event handler looks like this
> 
> # 'restart-spooler'  command definition
> define command{
> command_name	restart-spooler
> command_line /usr/local/nagios/libexec/eventhandlers/restart-spooler.sh
> $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$
> 	}
> 
> The script I use which is located in the eventhandler directory looks
> like this
> 
> rsh carling net start \"Spooler\"
> 
> 
> This works but only for the one server carling.
> 
> What can I change in the scripts for nagios to read a variable instead
> so that I can run the same script against multiple nt servers?
> 
> I am new to linux and nagios.
> 
> Thanks again
> 
> Andrew Sanderson.
> 
> 
> -----Original Message-----
> From: Rob Nelson [mailto:rob at capband.net] 
> Sent: Friday, July 11, 2003 10:36 AM
> To: Sanderson, Andrew; nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] [Nagios-users]
> 
> 
> >/usr/bin/rsh thentservername net start \"Spooler\"
> >
> >How can I have nagios enter the servername by reading the value of the 
> >$HOSTADRESS$ variable ?
> 
> Depending on how you have your active directory/nt4 domain structure set
> 
> up, they should respond as an IP (as in \\10.10.0.1). If not, you can
> make 
> sure that /etc/hosts is up to date and use a hostname instead of an IP 
> address for $HOSTADDRESS$. I'd definitely want it to be the former, but
> the 
> latter is a workable solution, just requires a wee bit more maintenance.
> 
> Also, if you're passing this to an external command, why not just add 
> another argument for the servername?
> 
> 
> Rob Nelson
> Network Administrator, Capitol Broadband
> C: 919-369-1874
> rob at capband.net 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Parasoft
> Error proof Web apps, automate testing & more.
> Download & eval WebKing and get a free book.
> www.parasoft.com/bulletproofapps1
> _______________________________________________
> 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


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
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