On Feb 5, 2010, at 10:25 AM, Scott, Ewan wrote:
> Hi
>
> I'm looking to get more information in my notificiation emails. Specifically,
> I'd like to get the text of Windows server Eventlogs into the body of the
> email. This information is coming across to the nagios server and can be
> found in the log file.
> See example below:
> Feb 5 15:08:36 sbc-omega-test nagios: SERVICE NOTIFICATION:
> nagiosadmin;hq-test-01;EventLog TempDB start
> chk;WARNING;notify-service-by-email;informational: MSSQLSERVER: Starting up
> database ReportServerTempDB. (384), eventlog: 384 warning
> I had hoped I could resolve this by changing the $SERVICEOUTPUT$ to
> $LONGSERVICEOUTPUT$ in the notify-service-by-email command definition (see
> below).
> # 'notify-service-by-email' command definition
> define command{
> command_name notify-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$LONGSERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$
> Service
> Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
> }
> However this did not give any change in the output. That's all I've changed
> on the server. Can anyone give me pointers as to what else I need to change?
$SERVICEOUTPUT$ is the macro that you want. It looks like the plugin is only
outputting one line of text. Make sure it is/was typed correctly in the
notification command above. --
http://nagios.sourceforge.net/docs/3_0/macrolist.html#serviceoutput
$SERVICEOUTPUT$ The first line of text output from the last service check (i.e.
"Ping OK").
$LONGSERVICEOUTPUT$ The full text output (aside from the first line) from the
last service check. (e.g. everything beyond the first line of text).
--
Marc
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Nagios-users mailing list
[email protected]
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