[Nagiosplug-devel] Plugin results not displaying correctly in nagios
Rick Garland
Rick.Garland at quantum.com
Fri Nov 19 19:44:55 CET 2010
Hi all:
Got Nagios 3.0.3 running on RHEL5.5
I made a shell script to dynamically look for and check the IF traffic
rate.
It is looking for /^bond/ || /^eth/ out of the netstat -i output
There are 3 interfaces, bond0, eth0 & eth1
>From command line, all 3 IFs are displayed correctly, each IF on is own
line with the performance data displayed correctly as well.
Here is the output from the command line.
[root at denlraptor libexec]# ./check_iftraf
bond0 receive=26676/min transmit=26100/min|bond0 26676;;;; 26100;;;;
eth0 receive=26664/min transmit=26100/min|eth0 26664;;;; 26100;;;;
eth1 receive=12/min transmit=0/min|eth1 12;;;; 0;;;;
The 'Services' nagios screen only displays one line, bond0 - which is
fine. Keep it short and I like that.
When I drill into the service, the display gets out of whack.
Example; The 'Status Information' will display the bond0 results and the
eth0 results but no eth1 results. The 'Performance Data' will display
the perf data for bond0 & eth0 then mix in the eth1 results and then
display the eth1 perf data.
If I omit the perf data, the results are displayed correctly. Here is
sample output from nagios;
Status Information: bond0 receive=276/min transmit=132/min
eth0 receive=264/min
transmit=132/min
eth1 receive=12/min transmit=0/min
Performance Data:
If I include perf data, I get the following output in nagios;
Status Information: bond0 receive=276/min transmit=132/min
eth0 receive=264/min
transmit=132/min
Performance Data: bond0 276;;;; 132;;;; eth0 264;;;; 132;;;; eth1
receive=12/min transmit=0/min|eth1 12;;;; 0;;;;
In the Perf Data are the results for eth1, which should be on the
Status line.
The eth1 receive=12/min transmit=0/min should not be on the
Performance Data line. It should be on the Status line but instead it is
mixed into the perf data.
Here is the echo line from the script.
echo "${int[$j]} receive=$RXOK/min transmit=$TXOK/min|${int[$j]}
$RXOK;;;; $TXOK;;;; "
Seems like I have too many characters. So how do I 'shift' to have the
correct display?
I am wanting to collect the perf data for all IFs and graph them. But
with the 'Status' & 'Performance' displays out of whack ...
Many thanks!
----------------------------------------------------------------------
The information contained in this transmission may be confidential. Any disclosure, copying, or further distribution of confidential information is not permitted unless such privilege is explicitly granted in writing by Quantum. Quantum reserves the right to have electronic communications, including email and attachments, sent across its networks filtered through anti virus and spam software programs and retain such messages in order to comply with applicable data security and retention requirements. Quantum is not responsible for the proper and complete transmission of the substance of this communication or for any delay in its receipt.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20101119/b184fad7/attachment.html>
More information about the Devel
mailing list