5 Nagios General Questions

Goutos, Kevin kgoutos at libertymgt.com
Fri Oct 23 17:04:02 CEST 2009


Thanks for the reply!


1)  Thank you for this information, however I'm still confused.  I did a
ps -A and confirmed that mutliple instances were running, so I followed
your steps, did a kill- 9 PID and restarted nagios.  I then removed a
host in my hosts.cfg file, did a /etc/rc.d/init.d/nagios reload and the
changes were Not made.  I still saw that host in my Nagios web
interface.  I even tried a stop | reload, but with the same results.
Finally, I stopped Nagios, and did the /usr/local/nagios/bin/nagios -d
/usr/local/nagios/etc/nagios.cfg and saw that the configs were updated,
and the hosts were removed.  If you could clarify this I would
appreciate it.

2) Below are my E-mail commands in commands.cfg.  I'm pretty sure I
haven't changed much, if anything, in them from the default values.  Am
I competely off based thinking there should be a body in these
notifcation alerts?

# 'notify-host-by-email' command definition
define command{
	command_name	notify-host-by-email
	command_line	/usr/bin/mail "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:
$HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:
$LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert:
$HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
	}

# 'notify-service-by-email' command definition
define command{
	command_name	notify-service-by-email
	command_line	/usr/bin/mail "%b" "***** Nagios
*****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:
$SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
$SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional
Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service
Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
	}

3) Thanks! I'll check some of the popular ones out first.

4) We're not running MTRG, but that is something I'm going to look into.

5) Thanks, I'll take a look at Cricket.




-----Original Message-----
From: Marc Powell [mailto:marc at ena.com] 
Sent: Friday, October 23, 2009 9:34 AM
To: Nagios-users at lists.sourceforge.net Mailinglist
Subject: Re: [Nagios-users] 5 Nagios General Questions


On Oct 22, 2009, at 2:29 PM, Goutos, Kevin wrote:

> Hi all,
>
> I have a few general Nagios questions for you all, I appreciate any
> feedback you can provide.
>
>
> 1) I don't think I'm restarting Nagios correctly whenever I make a
> change in a one of the configuration files.  I'm using
> /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg as  
> well
> as /etc/rc.d/init.d/nagios reload, restart, stop, start ,etc.

The first starts a new instance of nagios and the second reloads or  
reloads that new instance. If you do both, in that order, it does  
nothing for the *original* running version of nagios, which continues  
to run. You end up with two or more concurrently running versions of  
nagios, each with possibly different configurations in memory. Use  
only the init.d restart or reload. To 'fix' where you are now, stop  
nagios, use 'ps' and 'kill' to stop any running copies you have and  
restart nagios.

> 2) For my notifications, I'm not seeing anything in the body of the
> message.  All I see is the Message name "** PROBLEM Host Alert: CORP- 
> NSS
> is DOWN **".  I'm pretty sure there should be more information in the
> body.. any ideas?

Without seeing the actual notification command definition in question,  
we can only say to look at it and make sure that the macros you are  
using for it are valid for your version of nagios.

> 3) I've seen a couple plugins on a few sites I might want to check  
> out,
> how do I go about installing them?  I didn't find any documentation  
> for
> installing them..

Typically just copy them to the libexec directory and create  
appropriate command{} definitions for them. Hopefully the plugin  
author provides enough information or plugin --help to figure it out.  
Otherwise, your understanding how the current plugin <-> command{}  
definition <-> service{} definition relationship works is usually  
enough to know what to do. Read through the nagios documentation;  
it'll be worth it in the long term.

> 4) I'm looking for more ways to monitor our Routers and Switches here.
> Currently all I have is service checks of 'Ping Test' and 'System
> Uptime'.  I also saw on the quickstart guide the following service
> check, but I'm seeing errors.  The IP address there looks wrong, and
> it's saying it can't find a log.
>
> define service{
> 	use			generic-service
> 	hostgroup_name	switches
> 	service_description	Check Local Traffic
> 	check_command
> check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG! 
> 1000000,20000
> 00!5000000,5000000!10
> }

This plugin requires that you're already running the MRTG program  
(completely unrelated to Nagios) to pre-cache the results. It's simply  
reading the traffic usage from the MTRG log file, not from the router.  
Are you running MRTG and pointing it to the correct and existing log  
file (/var/lib/mrtg/192.168.1.253_1.log)? Are the permissions such  
that the nagios user can read it?

> 5) What other service checks do people use to monitor their switches  
> and
> routers?  We have SNMP enabled on them and want to collect more
> information through Nagios.

Ping, a bunch of custom checks (BGP peering, multi-interface checks,  
etc) for Nagios. We use Cricket for all utilization graphing/trending.

--
Marc


------------------------------------------------------------------------
------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and
stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
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