I’m setting up Nagios to verify IP connectivity of my servers. All servers do respond to ping from the outside world as long as they’re up. I’d like to have Nagios only attempt to ping the IP addresses I enter into the config file and then send out a notice if they are down. Everything seems to be working and I do get a notice if the IP is not reachable…but…I have to have smtp/ftp/pop added to the services in order for it to load the config file. I’m not concerened about smtp/ftp/pop…all I want to know is if the IP responds and send out a notice if it does not. I’ve tried loading the config file with just check_ping added to the config file, but I get the error message “There are no services defined!” in the logs. What am I doing wrong?
These are the current things I have added to the file:
timeperiod[24x7]=24 Hours A Day, 7 Days A Week;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00;00:00-24:00
timeperiod[workhours]=“Normal” Working Hours;;09:00-17:00;09:00-17:00;09:00-17:00;09:00-17:00;09:00-17:00;
timeperiod[nonworkhours]=Non-Work Hours;00:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-09:00,17:00-24:00;00:00-24:00
timeperiod[none]=No Time Is A Good Time;;;;;;;
host[testip]=VoIP Test IP;68.167.x.x;;check-host-alive;5;5;24x7;1;1;1;
hostgroup[VoIP-Customers]=All VoIP Cusotmers;VoIP-Alert;testip
command[notify-by-email]=/usr/bin/printf '***** NetSaint 0.0.7 \n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional Info:\n\n$OUTPUT$’ | /usr/bin/mail -s ’ $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ ’ $CONTACTEMAIL$
command[notify-by-epager]=/usr/bin/printf “Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$” | /usr/bin/mail -s ‘$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$’ $CONTACTPAGER$
command[host-notify-by-email]=/usr/bin/printf " NetSaint 0.0.7 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $OUTPUT$\n\nDate/Time: $DATETIME$\n" | /usr/bin/mail -s ‘Host $HOSTSTATE$ alert for $HOSTNAME$!’ $CONTACTEMAIL$
command[host-notify-by-epager]=/usr/bin/printf “Host ‘$HOSTALIAS$’ is $HOSTSTATE$\nInfo: $OUTPUT$\nTime: $DATETIME$” | /usr/bin/mail -s ‘$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$’ $CONTACTPAGER$
command[process-host-perfdata]=/usr/bin/printf “$LASTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$OUTPUT$\t$PERFDATA$” >> /tmp/host-perfdata
command[process-service-perfdata]=/usr/bin/printf “$LASTCHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$STATETYPE$\t$EXECUTIONTIME$\t$LATENCY$\t$OUTPUT$\t$PERFDATA$” >> /tmp/service-perfdata
contact[andysmith]=Andy Smith;24x7;24x7;1;1;1;1;1;1;notify-by-email;host-notify-by-email;[email protected]
contactgroup[VoIP-Alert]=Voip Alert Notification;andysmith
service[testip]=SMTP;0;24x7;3;3;1;VoIP-Alert;120;24x7;1;1;1;;check_smtp
service[testip]=FTP;0;24x7;3;5;1;VoIP-Alert;120;24x7;1;1;1;;check_ftp
service[testip]=POP3;0;24x7;3;5;1;VoIP-Alert;120;24x7;1;1;1;;check_pop
service[testip]=PING;0;24x7;3;5;1;VoIP-Alert;120;24x7;1;1;0;;check_ping