Parent Directory
|
Revision Log
Making scripts more flexible
1 | ronalds | 741 | #!/bin/sh |
2 | # shell script to submit the ACKNOWLEDGE_HOST_PROBLEM command to Nagios | ||
3 | |||
4 | now=`date +%s` | ||
5 | commandfile='/var/log/nagios/rw/nagios.cmd' | ||
6 | host=$1 | ||
7 | ronalds | 745 | ack=${2:-Forced Acknowledgement} |
8 | user=${3:-$(whoami)@$(hostname -s)} | ||
9 | ronalds | 741 | |
10 | ronalds | 745 | # ensure message and user contain sane values (no ; or newline) |
11 | ack=$(echo $ack | tr -d '[:cntrl:][;]') | ||
12 | user=$(echo $user | tr -d '[:cntrl:][;]') | ||
13 | |||
14 | /usr/bin/printf "[%lu] ACKNOWLEDGE_HOST_PROBLEM;$host;1;1;1;$user;$ack\n" $now > $commandfile |
Name | Value |
---|---|
svn:keywords | id |
grid.support@nikhef.nl | ViewVC Help |
Powered by ViewVC 1.1.28 |