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
_______________________________________________
mrtg mailing list
[email protected]
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg