RES: Cannot ping with APAN

jeff vier jeff.vier at tradingtechnologies.com
Thu Oct 16 18:35:59 CEST 2003


An easier (and better, in my opinion) solution is to hack the apan
script to use the hostaddress instead.

I did it already - patch is attached. (diff from apan.stock to apan in
nagios directory).  Notably, this patch makes ALL apan plugs use IP
instead of hostname on the command line (only).

Just add a seventh field in your checkcommands.cfg to make it work:
command_line    /usr/local/nagios/apan/apan.sh $ARG1$ $HOSTNAME$
"$SERVICEDESC$" $TIMET$ $ARG2$ $ARG3$ $HOSTADDRESS$

nice, eh?

On Thu, 2003-10-16 at 10:11, Marcio Queiroz wrote:
> Hi,
> 
> 1 - Apan does not use the HOSTADDRESS for ping, insted it uses the HOSTNAME
> for ping, so you have to put the address in the "hosts" file on the /etc
> directory. Use the same name you use in nagios, and this will work.
> 
> 2 - are this lines in the cgi.cfg? or are in a separte file, which the
> cgi.cfg calls ? like this :
> 
> in cgi.cfg :
> xedtemplate_config_file=/usr/local/nagios/etc/serviceextinfo.cfg
> 
> and in the serviceextinfo.cfg
> 
> 	        define serviceextinfo{
> 	        host_name               PDC
> 	        service_description     ping
> 	        notes_url
> 	/nagios/cgi-bin/apan.cgi?host=PDC&service=ping
> 	        icon_image              graph.png
> 	        icon_image_alt          View graphs
> 	}
> 
> 
> bye,
> 	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:		Jesús Oliván [SMTP:jesusolivan at pickingpack.net]
> > Enviada em:		quinta-feira, 16 de outubro de 2003 11:12
> > Para:		Nagios List
> > Assunto:		[Nagios-users] Cannot ping with APAN
> > 
> > Hi!
> > 
> > i'm trying to create some ping rtt reports with apan and rrdtool. I've saw
> > at apan documentation for installing and configuring it, but i didnt
> > success. Now i've got two problems:
> > 
> > 1.- nagios tell me "Status Information: PING CRITICAL - Host not found
> > (PDC)" when performing ping check with apan in my host "PDC". I've tried
> > to
> > perform manual plugin check and it returned this:
> > 
> > debian:/usr/local/nagios/etc# /usr/local/nagios/apan/apan.sh ping PDC ping
> > 10 150.0,20% 600.0,80%
> > (standard_in) 1: parse error
> > PING CRITICAL - Host not found (PDC)
> > 
> > Here is my checkcommands.cfg:
> > 
> > define command {
> >         command_name                   apan
> >         command_line                   /usr/local/nagios/apan/apan.sh
> > $ARG1$
> > $HOSTNAME$ "$SERVICEDESC$" $TIMET$ $ARG2$ $ARG3$
> > }
> > 
> > part of services.cfg:
> > 
> > # Generic service definition template
> > define service {
> > host_name                      PDC
> > service_description            ping
> > check_command                  apan!ping!100.0,20%!500.0,60%
> > name                           ping
> > use                            generic-service
> > normal_check_interval          1
> > check_period                    24x7
> >         max_check_attempts              3
> >         retry_check_interval            1
> >         contact_groups                  linux-admins
> >         notification_interval           120
> >         notification_period             24x7
> >         notification_options            w,u,c,r
> > 
> > }
> > 
> > and finally apan.cfg:
> > PDC;ping;/usr/local/nagios/rrd/PDC_Ping.rrd;ping;ping:LINE2;ping round
> > time;Seconds
> > 
> > 
> > 
> > 2.- Im trying to add an image linked to graphical report, but i didnt
> > success, attaching a bit of my cgi.cfg:
> > 
> >         define serviceextinfo{
> >         host_name               PDC
> >         service_description     ping
> >         notes_url
> > /nagios/cgi-bin/apan.cgi?host=PDC&service=ping
> >         icon_image              graph.png
> >         icon_image_alt          View graphs
> > }
> > 
> > I cannot see any icon with this configuration =(
> > 
> > 
> > That's all, thanks in advance for your help =)
> > 
> > 
> > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.net email is sponsored by: SF.net Giveback Program.
> > SourceForge.net hosts over 70,000 Open Source Projects.
> > See the people who have HELPED US provide better services:
> > Click here: http://sourceforge.net/supporters.php
> > _______________________________________________
> > 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 is sponsored by: SF.net Giveback Program.
> SourceForge.net hosts over 70,000 Open Source Projects.
> See the people who have HELPED US provide better services:
> Click here: http://sourceforge.net/supporters.php
> _______________________________________________
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apan.hostaddress.patch
Type: text/x-patch
Size: 9484 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20031016/3caef448/attachment.bin>


More information about the Users mailing list