[mrtg] Re: Threshold programs problem

mrtglist at keithbergen.com mrtglist at keithbergen.com
Tue Oct 24 18:49:28 MEST 2006

Thanks Steve for the "THRESH_DESC" explanation. Upon re-reading the config
documentation, it was very plainly stated (my bad!).

Does anybody have an idea why my program isn't seeing the $router,
$threshold, $current_value parameters?


-----Original Message-----
From: mrtg-bounce at list.ee.ethz.ch [mailto:mrtg-bounce at list.ee.ethz.ch] On
Behalf Of mrtglist at keithbergen.com
Sent: Monday, October 23, 2006 9:10 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] Threshold programs problem


I apologize if this has been discussed before, I'm a first-time subscriber
to this list. I have read the documentation up and down as well as many web
searches, and still can't figure out what I'm doing wrong.

I am using MRTG 2.14.7. It is monitoring a folder to see how many files are
in that folder. If the number exceed a threshold value, then I want an email
to go out.

I wrote the Perl script (Active State 5.8.8). That is supposed to take the
parameters passed by ThreshProgI. It seems that the MRTG program is not
passing the parameters (or is not passing them the way I would expect. It
also does not appear to be setting the "ThreshDesc" environment variable.

Here is a snip of my Perl script. Note that when I run the script from the
command line as "perl script param 10 200", it works fine. When the script
runs from MRTG, it doesn't have any of the parameters.

#!C:\perl\bin\perl.exe -w

use strict;
use Mail::Sendmail;

my $router = $ARGV[0];
my $threshold = $ARGV[1];
my $current_value = $ARGV[2];
my $logfile = "c:\\mrtg\\RCD\\notify.log";
my $description = $ENV{'ThreshDesc'};
my $timestamp = localtime();
my %mail;
# at this point, $router $threshold $current_value and $description are

Relevant MRTG Config Parameters:
ThreshDir: \\server\folder\DPC\Folder_Monitor\logs
ThreshMaxI[fld_cnt]: 10
ThreshProgI[fld_cnt]: c:\mrtg\RCD\notifyBAD.pl
ThreshProgOKI[fld_cnt]: c:\mrtg\RCD\notifyOK.pl

What am I doing wrong?


Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the mrtg mailing list