how to wrap long lines in config?
Tedman Eng
teng at dataway.com
Sun Aug 7 10:08:41 CEST 2005
Yes, you can wrap them in bash:
command_line notify_host.sh
notify_host.sh:
---------------
#!/bin/bash
/usr/bin/printf "%b" \
"Nagios System\n\n\
Notification Type: $NOTIFICATIONTYPE$\n\n\
Service: $SERVICEDESC$\n\
Host: $HOSTALIAS$\n\
Address: $HOSTADDRESS$\n\
State: $SERVICESTATE$\n\n\
Date/Time: $LONGDATETIME$\n\n\
Additional Info:\n\n\
$SERVICEOUTPUT$" \
| /usr/bin/mail -s \
"** $NOTIFICATIONTYPE$ alert - \
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" \
$CONTACTEMAIL$
---------------
-----Original Message-----
From: prosolutions at gmx.net [mailto:prosolutions at gmx.net]
Sent: Friday, August 05, 2005 8:28 PM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] how to wrap long lines in config?
some of the config lines look real ugly. like:
command_line /usr/bin/printf "%b" "Nagios System\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$
is it possible to wrap these ala bash to make them look sane? e.g.:
command_line /usr/bin/printf "%b" \
"Nagios System\n\n\
Notification Type: $NOTIFICATIONTYPE$\n\n\
Service: $SERVICEDESC$\n\
Host: $HOSTALIAS$\n\
Address: $HOSTADDRESS$\n\
State: $SERVICESTATE$\n\n\
Date/Time: $LONGDATETIME$\n\n\
Additional Info:\n\n\
$SERVICEOUTPUT$" \
| /usr/bin/mail -s \
"** $NOTIFICATIONTYPE$ alert - \
$HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" \
$CONTACTEMAIL$
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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