Problems with Apan

Hi,

I’m using apan to ping routers and switches in Nagios. I’m having
certain problems with some routers and switches not with all. I don’t
understand it. Perhaps, somebody could helps me…

1.- Viewing the Apan.debug:

vie feb 25 10:06:30 CET 2005 Args: ping Switch_Axpe1 Ping 1109322390
100.0,20% 500.0,60%
vie feb 25 10:06:30 CET 2005 Args: ping Switch_Axpe6 Ping 1109322390
100.0,20% 500.0,60%
vie feb 25 10:06:30 CET 2005 Args: ping Router_Axpe Ping 1109322390
3000.0,80% 5000.0,100%
Inserting ‘ping’ , ‘1109322390:.00189000000000000000’ into
/usr/share/nagios/rrd/Switch_Axpe6.rrd
Inserting ‘ping’ , ‘1109322390:.00175000000000000000’ into
/usr/share/nagios/rrd/Switch_Axpe1.rrd
Inserting ‘ping’ , ‘1109322390:.00320000000000000000’ into
/usr/share/nagios/rrd/Router_Axpe_Ping.rrd
vie feb 25 10:06:36 CET 2005 Args: Router_Axpe 1109322396
Could not insert ‘’ , ‘’ into
vie feb 25 10:06:36 CET 2005 Args: Switch_Axpe6 1109322396
Could not insert ‘’ , ‘’ into
vie feb 25 10:07:26 CET 2005 Args: ping Switch_Axpe2 Ping 1109322446
100.0,20% 500.0,60%
vie feb 25 10:07:26 CET 2005 Args: ping Router_Barna Ping 1109322446
3000.0,80% 5000.0,100%
vie feb 25 10:07:27 CET 2005 Args: ping Switch_Axpe7 Ping 1109322447
100.0,20% 500.0,60%
Inserting ‘ping’ , ‘1109322446:.00131000000000000000’ into
/usr/share/nagios/rrd/Switch_Axpe2.rrd
Inserting ‘ping’ , ‘1109322446:.24063000000000000000’ into
/usr/share/nagios/rrd/Router_Barna_Ping.rrd
Inserting ‘ping’ , ‘1109322447:.00344000000000000000’ into
/usr/share/nagios/rrd/Switch_Axpe7.rrd
vie feb 25 10:07:36 CET 2005 Args: Switch_Axpe2 1109322456
Could not insert ‘’ , ‘’ into
vie feb 25 10:08:24 CET 2005 Args: ping Router_JuanDeGaray Ping
1109322504 3000.0,80% 5000.0,100%
vie feb 25 10:08:26 CET 2005 Args: ping Switch_Axpe3 Ping 1109322506
100.0,20% 500.0,60%
vie feb 25 10:08:28 CET 2005 Args: ping Switch_CAI1 Ping 1109322508
100.0,20% 500.0,60%
Inserting ‘ping’ , ‘1109322504:.19269000000000000000’ into
/usr/share/nagios/rrd/Router_JuanDeGaray_Ping.rrd
Inserting ‘ping’ , ‘1109322506:.00200000000000000000’ into
/usr/share/nagios/rrd/Switch_Axpe3.rrd
Inserting ‘ping’ , ‘1109322508:.18327000000000000000’ into
/usr/share/nagios/rrd/Switch_CAI1.rrd

2.- Viewing the checkcommand.cfg:

#‘apan’ command definition. Runs apan on selected commands

define command {
command_name apan
command_line /usr/share/nagios/apan/apan.sh $ARG1$
$HOSTNAME$ $SERVICEDESC$ $TIMET$ $ARG2$ $ARG3$
}

3.- Viewing the Apan.defs:

#Base-directory for nagios:
NAGIOSDIR=/usr/share/nagios

#The directory where apan is installed
APANDIR=/usr/share/nagios/apan

#The directory where Nagios plugins resides
PLUGINSDIR=/usr/local/nagios/libexec

#The directory where Nagios .cfg-files resides
ETCDIR=/etc/nagios

The directory where apans plugins resides

PLUGSDIR=$APANDIR/plugs

The main config-file for apan

CFGFILE=$APANDIR/apan.cfg

Path to rrdtool

RRDTOOL=/usr/bin/rrdtool

Set DEBUG to 1 and define a DEBUGFILE to get debug-info from apan

DEBUG=1
DEBUGFILE=/tmp/apan.debug

Set CGIDEBUG to 1 and define a CGIDEBUGFILE to get debug-info from the cgi’s

CGIDEBUG=1
CGIDEBUGFILE=/tmp/apancgi.debug

A list of colors that are used to draw the lines in the graphs.

Beware of the syntax!!

COLS=("#ff0000" “#00ff00” “#0000ff” “#ffff00” “#ff00ff” “#00ffff
#ff8080” “#808080” “#8080ff” )

The type of image that is created. Valid values are PNG, GIF or GD

IMGTYPE=PNG

#End Configuration

4.- Viewing the apan.cfg:

Router_Axpe;Ping;/usr/share/nagios/rrd/Router_Axpe_Ping.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Router_JuanDeGaray;Ping;/usr/share/nagios/rrd/Router_JuanDeGaray_Ping.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
RouterCAI;Ping;/usr/share/nagios/rrd/RouterCAI_Ping.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Router_Madrid;Ping;/usr/share/nagios/rrd/Router_Madrid_Ping.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Router_Pamplona;Ping;/usr/share/nagios/rrd/Router_Pamplona_Ping.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Router_Barna;Ping;/usr/share/nagios/rrd/Router_Barna_Ping.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_CAI1;Ping;/usr/share/nagios/rrd/Switch_CAI1.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_CAI2;Ping;/usr/share/nagios/rrd/Switch_CAI2.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_CAI3;Ping;/usr/share/nagios/rrd/Switch_CAI3.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_Axpe1;Ping;/usr/share/nagios/rrd/Switch_Axpe1.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_Axpe2;Ping;/usr/share/nagios/rrd/Switch_Axpe2.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_Axpe3;Ping;/usr/share/nagios/rrd/Switch_Axpe3.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_Axpe4;Ping;/usr/share/nagios/rrd/Switch_Axpe4.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_Axpe5;Ping;/usr/share/nagios/rrd/Switch_Axpe5.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_Axpe6;Ping;/usr/share/nagios/rrd/Switch_Axpe6.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds
Switch_Axpe7;Ping;/usr/share/nagios/rrd/Switch_Axpe7.rrd;ping;ping:LINE2;Ping
round-trip time;Seconds

5.- Viewing routers.cfg:

Generic host definition template

define host{
name generic-host ; The name of
this host template - referenced in other host definition
s, used for template recursion/resolution
notifications_enabled 1 ; Host notifications are enabled
event_handler_enabled 1 ; Host event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status
information across program restarts
retain_nonstatus_information 1 ; Retain non-status
information across program restarts

   register                        0       ; DONT REGISTER THIS

DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}

Definicion de host ‘Cisco Axpe’

define host{
use generic-host ; Name of host
template to use

   host_name               Router_Axpe
   alias                   Router de Axpe
   address                 192.168.51.9
   check_command           apan
   max_check_attempts      20
   notification_interval   60
   notification_period     24x7
   notification_options    d,u,r
   }

Definicion de host ‘Cisco JuanDeGaray’

define host{
use generic-host ; Name of host
template to use

   host_name               Router_JuanDeGaray
   alias                   Router de Juan de Garay
   address                 192.168.58.254
   parents                 Router_Axpe
   check_command           apan
   max_check_attempts      20
   notification_interval   60
   notification_period     24x7
   notification_options    d,u,r
   }

Definicion de host ‘Cisco CAI’

define host{
use generic-host ; Name of host
template to use

   host_name               RouterCAI
     alias                   Router del CAI
   address                 13.9.200.100
   parents                 Router_Axpe
   check_command           apan
   max_check_attempts      20
   notification_interval   60
   notification_period     24x7
   notification_options    d,u,r
   }

Defcion de host ‘Cisco Iruña’

define host{
use generic-host ; Name of host
template to use

   host_name               Router_Pamplona
   alias                   Router de Pamplona
   address                 192.168.54.2
   parents                 Router_Axpe
   check_command           apan
   max_check_attempts      20
   notification_interval   60
   notification_period     24x7
   notification_options    d,u,r
   }

Defcion de host ‘Cisco Madrid’

define host{
use generic-host ; Name of host
template to use

   host_name               Router_Madrid
   alias                   Router de Madrid
   address                 172.16.1.1
   parents                 Router_Axpe
   check_command           apan
   max_check_attempts      20
   notification_interval   60
   notification_period     24x7
   notification_options    d,u,r
   }

Defcion de host ‘Cisco Barna’

define host{
use generic-host ; Name of host
template to use

   host_name               Router_Barna
   alias                   Router de Barcelona
   address                 172.17.1.1
   parents                 Router_Axpe
   check_command           apan
   max_check_attempts      20
   notification_interval   60
   notification_period     24x7
   notification_options    d,u,r
   }

6.- Viewing Routerserv.cfg:

Generic service definition template

define service{
name generic-service ; The ‘name’
of this service template, referenced in other service def
initions
active_checks_enabled 1 ; Active service
checks are enabled
passive_checks_enabled 1 ; Passive service
checks are enabled/accepted
parallelize_check 1 ; Active service
checks should be parallelized (disabling this can lead to maj
or performance problems)
obsess_over_service 1 ; We should obsess
over this service (if necessary)
check_freshness 0 ; Default is to NOT
check service ‘freshness’
notifications_enabled 1 ; Service
notifications are enabled
event_handler_enabled 1 ; Service event
handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status
information across program restarts
retain_nonstatus_information 1 ; Retain non-status
information across program restarts

   register                        0       ; DONT REGISTER THIS

DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}

Service definition

define service{
use generic-service ; Name
of service template to use

   host_name                       Router_Axpe
   service_description             Ping
   is_volatile                     0
   check_period                    24x7
   max_check_attempts              3
   normal_check_interval           5
   retry_check_interval            1
   contact_groups                  router-admins
   notification_interval           240
   notification_period             24x7
   notification_options            c,r
   name                            Ping
   check_command                   apan!ping!3000.0,80%!5000.0,100%
   }

Service definition

define service{
use generic-service ; Name
of service template to use

   host_name                       Router_JuanDeGaray
   service_description             Ping
   is_volatile                     0
   check_period                    24x7
   max_check_attempts              3
   normal_check_interval           5
   retry_check_interval            1
   contact_groups                  router-admins
   notification_interval           240
   notification_period             24x7
   notification_options            c,r
   name                            Ping
   check_command                   apan!ping!3000.0,80%!5000.0,100%
   }

Service definition

define service{
use generic-service ; Name
of service template to use

   host_name                       RouterCAI
   service_description             Ping
   is_volatile                     0
   check_period                    24x7
   max_check_attempts              3
   normal_check_interval           5
   retry_check_interval            1
   contact_groups                  router-admins
   notification_interval           240
   notification_period             24x7
   notification_options            c,r
   name                            Ping
   check_command                   apan!ping!3000.0,80%!5000.0,100%
   }

Service definition

define service{
use generic-service ; Name
of service template to use

   host_name                       Router_Pamplona
   service_description             Ping
   is_volatile                     0
   check_period                    24x7
   max_check_attempts              3
   normal_check_interval           5
   retry_check_interval            1
   contact_groups                  router-admins
   notification_interval           240
   notification_period             24x7
   notification_options            c,r
   name                            Ping
   check_command                   apan!ping!3000.0,80%!5000.0,100%
   }

Service definition

define service{
use generic-service ; Name
of service template to use

   host_name                       Router_Madrid
   service_description             Ping
   is_volatile                     0
   check_period                    24x7
   max_check_attempts              3
   normal_check_interval           5
   retry_check_interval            1
   contact_groups                  router-admins
   notification_interval           240
   notification_period             24x7
   notification_options            c,r
   name                            Ping
   check_command                   apan!ping!3000.0,80%!5000.0,100%
   }

Service definition

define service{
use generic-service ; Name
of service template to use

   host_name                       Router_Barna
   service_description             Ping
   is_volatile                     0
   check_period                    24x7
   max_check_attempts              3
   normal_check_interval           5
   retry_check_interval            1
   contact_groups                  router-admins
   notification_interval           240
   notification_period             24x7
   notification_options            c,r
   name                            Ping
   check_command                   apan!ping!3000.0,80%!5000.0,100%
   }

7.- Viewing routersgrupo.cfg:

‘routers’ host group definition

define hostgroup{
hostgroup_name Routers
alias Enrutadores
contact_groups router-admins
members
Router_Axpe,Router_JuanDeGaray,RouterCAI,Router_Pamplona,Router_Madrid,Router_Barna
}

8.- Viewing the /etc/hosts:

Do not remove the following line, or various programs

that require network functionality will fail.

127.0.0.1 Popeye localhost.localdomain localhost

#Routers
13.9.200.100 RouterCAI
192.168.51.9 Router_Axpe
192.168.58.254 Router_JuanDeGaray
192.168.54.2 Router_Pamplona
172.16.1.1 Router_Madrid
172.17.1.1 Router_Barna

#Switches de Axpe
192.168.51.1 Switch_Axpe1
192.168.51.2 Switch_Axpe2
192.168.51.3 Switch_Axpe3
192.168.51.5 Switch_Axpe4
192.168.51.6 Switch_Axpe5
192.168.51.7 Switch_Axpe6
192.168.51.8 Switch_Axpe7

Switches del CAI

13.9.200.41 Switch_CAI1
13.9.200.42 Switch_CAI2
13.9.200.43 Switch_CAI3


i think this could help you…
sourceforge.net/mailarchive/for … um_id=1873