[mrtg] Blank graph with custom script

Steve Shipway s.shipway at auckland.ac.nz
Fri Jun 1 22:23:36 CEST 2012


You dont give an example of the script output; possibly it is not quite correct?  It should be 4 lines; the 3rd and 4th can be blank if you want, the first two must contain ONLY a nmber.

You are using the 'gauge' option - if this counter returns a constantly increasing value, you should not use this, in order to convert to a rate.

Possibly the returned value is out of range, or is generating a range too small to register, or has a syntax problem?

Try running MRTG interactively and see if it produces any useful error messages relating to this target.

Steve

Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
Ph: +64 9 373 7599 ext 86487

________________________________
From: mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch [mrtg-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] on behalf of Lists [lists at murrell.ca]
Sent: Friday, 1 June 2012 7:19 p.m.
To: mrtg at lists.oetiker.ch
Subject: [mrtg] Blank graph with custom script


I am using a custom perl script to query an MS Exchange server using check_nt for SMT traffic.  I run the script manually and it returns two numbers, one on each line.  The first is bytes received and the other is bytes sent.  I have run the script a few times and can see the numbers change.

When I added the config to my .cfg file, it creates the image files and .log file, but the numbers in the log file are all 0s.  I am including my script and snippet from my .cfg file below.

--- SCRIPT ---
#!/usr/bin/perl

# Replace '/usr/lib/nagios/plugins/check_nt' with the localtion where your check_nt binary is located

$sent    = `/usr/lib/nagios/plugins/check_nt -H $ARGV[0] -p 12489 -v COUNTER -l "\\MSExchangeTransport SmtpSend(_Total)\\Bytes Sent Total"`;
chomp $sent;
$receive = `/usr/lib/nagios/plugins/check_nt -H $ARGV[0] -p 12489 -v COUNTER -l "\\MSExchangeTransport SmtpReceive(_Total)\\Bytes Received Total"`;
chomp $receive;

print $sent . "\n"
      . $receive .
     "\n";
--- SCRIPT ---

--- mrt.cfg ---
### Exchange 2007 Stats: SMTP Traffic
Target[rcav-ex01.msexchange.smtptraffic]: `/etc/mrtg/scripts/exchange2007_SMTP_traffic.pl rcav-ex01`
MaxBytes[rcav-ex01.msexchange.smtptraffic]: 125000000
Title[rcav-ex01.msexchange.smtptraffic]: RCAV-EX01 SMTP Traffic
PageTop[rcav-ex01.msexchange.smtptraffic]: <h1>SMTP Traffic</h1>
Options[rcav-ex01.msexchange.smtptraffic]: gauge,nopercent,growright
#Unscaled[rcav-ex01.msexchange.smtptraffic]: dwym
kMG[rcav-ex01.msexchange.smtptraffic]: KB,MB,GB
YLegend[rcav-ex01.msexchange.smtptraffic]: Kilobytes
ShortLegend[rcav-ex01.msexchange.smtptraffic]:
#Kilo[rcav-ex01.msexchange.smtptraffic]: 1024
Legend1[rcav-ex01.msexchange.smtptraffic]: Total Bytes Sent
Legend2[rcav-ex01.msexchange.smtptraffic]: Total Bytes Sent
LegendI[rcav-ex01.msexchange.smtptraffic]: Total Bytes Received
LegendO[rcav-ex01.msexchange.smtptraffic]: Total Bytes Received
--- mt.cfg ---

The script, as you can see, takes as its only argument, the server to check.  As I mentioned, I can run that exact line from the CLI and it returns values.

Any ideas what might the issue be?  Thanks, in advance.

-Alan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20120601/5048dc7d/attachment.htm 


More information about the mrtg mailing list