[mrtg] Thresholds Question....?

Madden, Jay F jay_madden at reyrey.com
Thu Mar 2 23:54:07 MET 2000


I am trying to setup thresholds, I have setup a test config (included
below). When I run mrtg manually against the config I get the following
error:

CFG Error in "threshprogo[myrouter.mydomain.com]", line 18: Threshold
program "/usr/local/mrtg/CONFIGS/myscript.sh" cannot be executed

I am trying to execute a Shell script that will fire a mail message when a
threshold is crossed, I have tested the scipt by executing it stanalone with
the arguments passed in, and the script sends mail every time. I am guessing
that mrtg doesn't like it because it's a shell script? I am running other
collectors with perl scripts called on the Target[] line with no trouble. I
have included my config and script files below for review. Any help would be
greatly appreciated......Thanks in advance.......Jay


****MY TEST CONFIG FILE*****
######################################################################

WorkDir: /home/httpd/html
ThreshDir: /tmp/mrtg
#---------------------------------------------------------------
Target[xxxx.xxxx.com]: 1:xxxx at xxxx.xxxx.com
MaxBytes[xxxx.xxxx.com]: 1250000
Title[xxxx.xxxx.com]: xxxx (xxxx.xxxx.com): Ethernet0/0
ThreshMinO[xxxx.xxxx.com]: 300000 
ThreshMaxO[xxxx.xxxx.com]: 500000
ThreshProgO[xxxx.xxxx.com]: '/usr/local/mrtg/CONFIGS/myscript.sh'
PageTop[xxxx.xxxx.com]: <H1>Traffic Analysis for Ethernet0/0
 <BR>Link to Public Subnet</H1>
 <TABLE>
   <TR><TD>System:</TD><TD>xxxxxxxxxxxxx</TD></TR>
   <TR><TD>Maintainer:</TD><TD>xxxxxxxxxxx       </TD></TR>
   <TR><TD>Interface:</TD><TD>Ethernet0/0 (1)</TD></TR>
   <TR><TD>IP:</TD><TD>xxxx.xxxx.com (xxx.xxx.xxx.xxx)</TD></TR>
   <TR><TD>Max Speed:</TD>
       <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>
  </TABLE>

#---------------------------------------------------------------
 



  
****MY MAIL SCRIPT *****
#!/bin/bash
#######################################################################
# Generic script for forwarding Mail from MRTG 
#
# Parameters to be passed from MRTG: 
# $1 - Device 
# $2 - Threshold 
# $3 - Value 
# Parameters to be Set In Script Are:
# $ADDRESS - Email Address 
#######################################################################
#
ADDRESS='xxxxxxxx at xxxxx.com'

cat <<EOF > /tmp/tmp.$$

A Threshold Crossing Has Occurred On The Following Device: $1, 
The Threshold Setting Value Is: $2
The Current Measurement Value Is: $3

Sent by MRTG 
EOF
mail -s TEST2 $ADDRESS < /tmp/tmp.$$
rm /tmp/tmp.$$      




Jay F. Madden
Network Analyst
ETS Operations Control Center
(PH: 937-485-9635) (FX: 937-485-9330)


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list