Re: [Nagios-users] $SERVICEOUTPUT$ missing from emails.. Nagios 3.2.1
Ok, found a workaround in this message: http://www.mail-archive.com/nagios-users@lists.sourceforge.net/msg23566.html Instead of /usr/bin/printf "%b" use /bin/echo -e so, notify-service-by-email becomes: define command{ command_namenotify-service-by-email command_line/bin/echo -e "* Nagios *\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info Aggiuntive:\n\n$SERVICEOUTPUT$ - $LONGSERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ } Cheers. -- ___ Nagios-users mailing list Nagios-users@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
[Nagios-users] Timeperiods and oncall rotation with UK Public holidays
Folks, I'm using SLES 10 and Nagios 3.2.0. We have 4 oncall engineers which rotate over a 4 week period, each being oncall one week at a time. The oncall period is 17:30 - 08:00 each working day and then the whole period for any weekend or UK public holiday. My definitions are :- define timeperiod{ timeperiod_name 24x7 alias 24 Hours A Day, 7 Days A Week sunday 00:00-24:00 monday 00:00-24:00 tuesday 00:00-24:00 wednesday 00:00-24:00 thursday00:00-24:00 friday 00:00-24:00 saturday00:00-24:00 } This is for all normal monitoring of our systems. Each oncall engineer is defined :- define timeperiod{ timeperiod_name person1-oncall alias person1-oncall 2010-03-29 / 28 17:30-24:00 ; Monday 2010-03-30 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-03-31 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-01 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-02 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-03 / 28 00:00-24:00 ; Saturday 2010-04-04 / 28 00:00-24:00 ; Sunday 2010-04-05 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person2-oncall alias person2-oncall 2010-04-05 / 28 17:30-24:00 ; Monday 2010-04-06 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-07 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-08 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-09 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-10 / 28 00:00-24:00 ; Saturday 2010-04-11 / 28 00:00-24:00 ; Sunday 2010-04-12 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person3-oncall alias person3-oncall 2010-04-12 / 28 17:30-24:00 ; Monday 2010-04-13 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-14 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-15 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-16 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-17 / 28 00:00-24:00 ; Saturday 2010-04-18 / 28 00:00-24:00 ; Sunday 2010-04-19 / 28 00:00-08:00 ; Monday } define timeperiod{ timeperiod_name person4-oncall alias person4-oncall 2010-04-19 / 28 17:30-24:00 ; Monday 2010-04-20 / 28 00:00-08:00,17:30-24:00 ; Tuesday 2010-04-21 / 28 00:00-08:00,17:30-24:00 ; Wednesday 2010-04-22 / 28 00:00-08:00,17:30-24:00 ; Thursday 2010-04-23 / 28 00:00-08:00,17:30-24:00 ; Friday 2010-04-24 / 28 00:00-24:00 ; Saturday 2010-04-25 / 28 00:00-24:00 ; Sunday 2010-04-26 / 28 00:00-08:00 ; Monday } I have escalations set for one particular client which will happen during oncall hours only and depending on the notification number, (4,5,6) will send an SMS alert to the relevant person oncall. ## Escalation ONE: define serviceescalation { host_name dbhost1 service_description DB Conn Check first_notification 4 last_notification 6 notification_interval 15 escalation_options c ; Only escalate for CRITICAL alerts escalation_period oncall contact_groups wx2-sms-oncall-group } define timeperiod{ timeperiod_name oncall alias Oncall Hours sunday 00:00-24:00 monday 00:00-08:00,17:30-24:00 tuesday 00:00-08:00,17:30-24:00 wednesday 00:00-08:00,17:30-24:00 thursday00:00-08:00,17:30-24:00 friday 00:00-08:00,17:30-24:00 saturday00:00-24:00 } And the sms-oncall-group defined for the service escalation includes all 4 oncall engineers but only the person actually oncall should get the sms alert based on their oncall timeperiods. define contactgroup{ contactgroup_name wx2-sms-oncall-group alias WX2 Oncall members person1-oncall, person2-oncall, person3-oncall, person4-oncall } However, I've now hit a snag - how do I define UK public holidays periods as being 24 hours (particularly if they fall on a weekday) and put that timeperiod into each oncall engineers timeperiod so whoever is oncall on a particular UK public holiday will get the escalation alerts for the entire 24 hour period rather than the usual defined oncall period of "00:00-08:00 and 17:30-24:00" I'd rather not explicitly define a UK holiday date to an oncall engineer as this would need to be maintained. I'd rather just have to update the timepe
Re: [Nagios-users] $SERVICEOUTPUT$ missing from emails.. Nagios 3.2.1
Hi, this is the definition: define command{ command_namenotify-service-by-email command_line/usr/bin/printf "%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$ - $LONGSERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ } And this is the output from notify-service-by-email, not showing $SERVICEOUTPUT$ - $LONGSERVICEOUTPUT$: * Nagios * Notification Type: PROBLEM Service: Totale Processi Host: Nagios Address: 127.0.0.1 State: WARNING Date/Time: Wed Apr 21 12:34:30 CEST 2010 Additional Info: -- ___ Nagios-users mailing list Nagios-users@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
Re: [Nagios-users] $SERVICEOUTPUT$ missing from emails.. Nagios 3.2.1
Hi, I have the same problem. Just the %SERVICEOUTPUT$ and "LONGSERVICEOUTPUT$ are missing from notification emails. I am checking what can be the problem. > Hi Matt, > We receive the emails ok, just missing the $SERVICEOUTPUTS$ part.. > > -Peter > > > -Original Message- > From: Matt Simmons [mailto:standalone.sysad...@gmail.com] > Sent: Tuesday, April 20, 2010 7:46 AM > To: Nagios Users List > Subject: Re: [Nagios-users] $SERVICEOUTPUT$ missing from emails.. Nagios > 3.2.1 > > Have you verified that your MTA is operating correctly? Try sending mail > from the command line (echo "test 1" | mail -s "test 1" > em...@address.com) and see if that goes through, before you suspect > Nagios. > > --Matt > > > On Tue, Apr 20, 2010 at 7:34 AM, Marc Powell wrote: >> >> On Apr 19, 2010, at 10:34 PM, Peter Kranz wrote: >> >>> It's the default that comes with the .tar: >>> >>> # 'notify-by-email' command definition define command{ >>>command_namenotify-by-email >>>command_line/usr/bin/printf "%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$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ >>> alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" >>> $CONTACTEMAIL$ >>>} >> >> Make sure the contact is using 'notify-by-email' as their service >> notification command. There have been no reports of this as a bug so I'd >> greatly lean toward it being a configuration issue. >> >> -- >> Marc >> >> >> -- >> Download Intel® Parallel Studio Eval Try the new >> software tools for yourself. Speed compiling, find bugs proactively, >> and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> ___ >> Nagios-users mailing list >> Nagios-users@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 >> > > > > -- > LITTLE GIRL: But which cookie will you eat FIRST? > COOKIE MONSTER: Me think you have misconception of cookie-eating process. > > COOKIE MONSTER: Boy, I wish I were a sysadmin so I could go to the NJ-PICC > Sysadmin Conference! http://www.picconf.org > > -- > Download Intel® Parallel Studio Eval Try the new software tools for > yourself. Speed compiling, find bugs proactively, and fine-tune > applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > ___ > Nagios-users mailing list > Nagios-users@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 > > > -- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > ___ > Nagios-users mailing list > Nagios-users@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 > -- ___ Nagios-users mailing list Nagios-users@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