The mail commands are borked.<br /><br />Change /usr/bin/mail "%b"  to /usr/bin/printf "%b"<br /><br />The command, as you currently have it, is mailing nonsense to a piped mail command.  <br />Making the above change will actually pipe the body to the mail command instead...<br /><br />On Oct 23, 2009 11:04am, "Goutos, Kevin" <kgoutos@libertymgt.com> wrote:<br />> Thanks for the reply!<br />> <br />> <br />> <br />> <br />> <br />> 1)  Thank you for this information, however I'm still confused.  I did a<br />> <br />> ps -A and confirmed that mutliple instances were running, so I followed<br />> <br />> your steps, did a kill- 9 PID and restarted nagios.  I then removed a<br />> <br />> host in my hosts.cfg file, did a /etc/rc.d/init.d/nagios reload and the<br />> <br />> changes were Not made.  I still saw that host in my Nagios web<br />> <br />> interface.  I even tried a stop | reload, but with the same results.<br />> <br />> Finally, I stopped Nagios, and did the /usr/local/nagios/bin/nagios -d<br />> <br />> /usr/local/nagios/etc/nagios.cfg and saw that the configs were updated,<br />> <br />> and the hosts were removed.  If you could clarify this I would<br />> <br />> appreciate it.<br />> <br />> <br />> <br />> 2) Below are my E-mail commands in commands.cfg.  I'm pretty sure I<br />> <br />> haven't changed much, if anything, in them from the default values.  Am<br />> <br />> I competely off based thinking there should be a body in these<br />> <br />> notifcation alerts?<br />> <br />> <br />> <br />> # 'notify-host-by-email' command definition<br />> <br />> define command{<br />> <br />>         command_name    notify-host-by-email<br />> <br />>         command_line    /usr/bin/mail "%b" "***** Nagios<br />> <br />> *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState:<br />> <br />> $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time:<br />> <br />> $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert:<br />> <br />> $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$<br />> <br />>         }<br />> <br />> <br />> <br />> # 'notify-service-by-email' command definition<br />> <br />> define command{<br />> <br />>         command_name    notify-service-by-email<br />> <br />>         command_line    /usr/bin/mail "%b" "***** Nagios<br />> <br />> *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService:<br />> <br />> $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:<br />> <br />> $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional<br />> <br />> Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service<br />> <br />> Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$<br />> <br />>         }<br />> <br />> <br />> <br />> 3) Thanks! I'll check some of the popular ones out first.<br />> <br />> <br />> <br />> 4) We're not running MTRG, but that is something I'm going to look into.<br />> <br />> <br />> <br />> 5) Thanks, I'll take a look at Cricket.<br />> <br />> <br />> <br />> <br />> <br />> <br />> <br />> <br />> <br />> -----Original Message-----<br />> <br />> From: Marc Powell [mailto:marc@ena.com]<br />> <br />> Sent: Friday, October 23, 2009 9:34 AM<br />> <br />> To: Nagios-users@lists.sourceforge.net Mailinglist<br />> <br />> Subject: Re: [Nagios-users] 5 Nagios General Questions<br />> <br />> <br />> <br />> <br />> <br />> On Oct 22, 2009, at 2:29 PM, Goutos, Kevin wrote:<br />> <br />> <br />> <br />> > Hi all,<br />> <br />> ><br />> <br />> > I have a few general Nagios questions for you all, I appreciate any<br />> <br />> > feedback you can provide.<br />> <br />> ><br />> <br />> ><br />> <br />> > 1) I don't think I'm restarting Nagios correctly whenever I make a<br />> <br />> > change in a one of the configuration files.  I'm using<br />> <br />> > /usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg as<br />> <br />> > well<br />> <br />> > as /etc/rc.d/init.d/nagios reload, restart, stop, start ,etc.<br />> <br />> <br />> <br />> The first starts a new instance of nagios and the second reloads or<br />> <br />> reloads that new instance. If you do both, in that order, it does<br />> <br />> nothing for the *original* running version of nagios, which continues<br />> <br />> to run. You end up with two or more concurrently running versions of<br />> <br />> nagios, each with possibly different configurations in memory. Use<br />> <br />> only the init.d restart or reload. To 'fix' where you are now, stop<br />> <br />> nagios, use 'ps' and 'kill' to stop any running copies you have and<br />> <br />> restart nagios.<br />> <br />> <br />> <br />> > 2) For my notifications, I'm not seeing anything in the body of the<br />> <br />> > message.  All I see is the Message name "** PROBLEM Host Alert: CORP-<br />> <br />> > NSS<br />> <br />> > is DOWN **".  I'm pretty sure there should be more information in the<br />> <br />> > body.. any ideas?<br />> <br />> <br />> <br />> Without seeing the actual notification command definition in question,<br />> <br />> we can only say to look at it and make sure that the macros you are<br />> <br />> using for it are valid for your version of nagios.<br />> <br />> <br />> <br />> > 3) I've seen a couple plugins on a few sites I might want to check<br />> <br />> > out,<br />> <br />> > how do I go about installing them?  I didn't find any documentation<br />> <br />> > for<br />> <br />> > installing them..<br />> <br />> <br />> <br />> Typically just copy them to the libexec directory and create<br />> <br />> appropriate command{} definitions for them. Hopefully the plugin<br />> <br />> author provides enough information or plugin --help to figure it out.<br />> <br />> Otherwise, your understanding how the current plugin  command{}<br />> <br />> definition  service{} definition relationship works is usually<br />> <br />> enough to know what to do. Read through the nagios documentation;<br />> <br />> it'll be worth it in the long term.<br />> <br />> <br />> <br />> > 4) I'm looking for more ways to monitor our Routers and Switches here.<br />> <br />> > Currently all I have is service checks of 'Ping Test' and 'System<br />> <br />> > Uptime'.  I also saw on the quickstart guide the following service<br />> <br />> > check, but I'm seeing errors.  The IP address there looks wrong, and<br />> <br />> > it's saying it can't find a log.<br />> <br />> ><br />> <br />> > define service{<br />> <br />> >       use                     generic-service<br />> <br />> >       hostgroup_name  switches<br />> <br />> >       service_description     Check Local Traffic<br />> <br />> >       check_command<br />> <br />> > check_local_mrtgtraf!/var/lib/mrtg/192.168.1.253_1.log!AVG!<br />> <br />> > 1000000,20000<br />> <br />> > 00!5000000,5000000!10<br />> <br />> > }<br />> <br />> <br />> <br />> This plugin requires that you're already running the MRTG program<br />> <br />> (completely unrelated to Nagios) to pre-cache the results. It's simply<br />> <br />> reading the traffic usage from the MTRG log file, not from the router.<br />> <br />> Are you running MRTG and pointing it to the correct and existing log<br />> <br />> file (/var/lib/mrtg/192.168.1.253_1.log)? Are the permissions such<br />> <br />> that the nagios user can read it?<br />> <br />> <br />> <br />> > 5) What other service checks do people use to monitor their switches<br />> <br />> > and<br />> <br />> > routers?  We have SNMP enabled on them and want to collect more<br />> <br />> > information through Nagios.<br />> <br />> <br />> <br />> Ping, a bunch of custom checks (BGP peering, multi-interface checks,<br />> <br />> etc) for Nagios. We use Cricket for all utilization graphing/trending.<br />> <br />> <br />> <br />> --<br />> <br />> Marc<br />> <br />> <br />> <br />> <br />> <br />> ------------------------------------------------------------------------<br />> <br />> ------<br />> <br />> Come build with us! The BlackBerry(R) Developer Conference in SF, CA<br />> <br />> is the only developer event you need to attend this year. Jumpstart your<br />> <br />> developing skills, take BlackBerry mobile applications to market and<br />> <br />> stay<br />> <br />> ahead of the curve. Join us from November 9 - 12, 2009. Register now!<br />> <br />> http://p.sf.net/sfu/devconference<br />> <br />> _______________________________________________<br />> <br />> Nagios-users mailing list<br />> <br />> Nagios-users@lists.sourceforge.net<br />> <br />> https://lists.sourceforge.net/lists/listinfo/nagios-users<br />> <br />> ::: Please include Nagios version, plugin version (-v) and OS when<br />> <br />> reporting any issue.<br />> <br />> ::: Messages without supporting info will risk being sent to /dev/null<br />> <br />> <br />> <br />> ------------------------------------------------------------------------------<br />> <br />> Come build with us! The BlackBerry(R) Developer Conference in SF, CA<br />> <br />> is the only developer event you need to attend this year. Jumpstart your<br />> <br />> developing skills, take BlackBerry mobile applications to market and stay<br />> <br />> ahead of the curve. Join us from November 9 - 12, 2009. Register now!<br />> <br />> http://p.sf.net/sfu/devconference<br />> <br />> _______________________________________________<br />> <br />> Nagios-users mailing list<br />> <br />> Nagios-users@lists.sourceforge.net<br />> <br />> https://lists.sourceforge.net/lists/listinfo/nagios-users<br />> <br />> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<br />> <br />> ::: Messages without supporting info will risk being sent to /dev/null<br />>