check_mrtgtraf syntax

Michael S. Kazmier mkazmier at sofast.net
Wed Jun 25 17:18:36 CEST 2003


Thanks David,

That helped a ton!

-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of David Waldo
Sent: Tuesday, June 24, 2003 10:15 AM
To: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] check_mrtgtraf syntax

Hi Mike -

I found check_mrtgtraf a little confusing also. Checking the C source,
I found that it wants Bytes/Second:

        /* report incoming traffic in Bytes/sec */
        if (incoming_rate < 1024) {
                strcpy (incoming_speed_rating, "B/s");
                adjusted_incoming_rate = (double) incoming_rate;
        }

        /* report incoming traffic in KBytes/sec */
        else if (incoming_rate < (1024 * 1024)) {
                strcpy (incoming_speed_rating, "KB/s");
                adjusted_incoming_rate = (double) (incoming_rate / 1024.0);
        }

        /* report incoming traffic in MBytes/sec */
        else {
                strcpy (incoming_speed_rating, "MB/s");
                adjusted_incoming_rate = (double) (incoming_rate / 1024.0 /
1024.0);
        }

So I use the following check_command on our T1 line. MRTG reports the max 
speed to be 1536.0 kbits/s, so I convert it to max bytes/s with 

	1536 x 1024 / 8 = 196608 Bytes/s

# 'check_mrtg' command definition
# check_mrtgtraf checks simple MRTG traffic metrics
# -F: The /projects/mrtg/htdocs/router/198.76.172.1_2.log is the MRTG
#     log for our T1 conntection (1536 kbit/sec or 196608 Bytes/sec MAX).
# -e: If the file is older than N minutes old, this plug-in will issue a
#     warning and exit.
# -a: You can monitor either AVG or MAX. After looking over the MRTG logs,
#     it looks like AVG is the most meaningfull to monitor.
# -w: WARNING parameters in bytes <INPUT, OUTPUT>. 147456 is 75% of the our
#     T1 capacity (196608 Bytes).
# -c: CRITICAL parameters in bytes <INPUT, OUTPUT>. 176947 is 95% of the our
#     T1 capacity (196608 Bytes).
define command{
        command_name    check_mrtg
        command_line    $USER1$/check_mrtgtraf
-F/projects/mrtg/htdocs/router/198.76.172.1_2.log -e10 -aAVG
-w"147456,147456" -c"176947,176947"
        }


Also, the check_mrtgtraf plugin prints no output for critical or warning
states,
so I patched the source with this:


203a204
>               printf("%s\n", error_message);
211a213,214
>               printf("%s\n", error_message);
>

- Dave Waldo 




-----Original Message-----
From: Michael S. Kazmier [mailto:mkazmier at sofast.net]
Sent: Tuesday, June 24, 2003 10:50 AM
To: nagios-users at lists.sourceforge.net
Subject: [Nagios-users] check_mrtgtraf syntax


He all,  I was not sure how to handle the syntax of a check_mrtgtraf command
for the warnings and critical variables.

Here is my question, if check_mrtgtraf returns its results in KB/s, should
the critical and warning variables also be in KB/s or in b/s?

Any real world examples out there - we are pulling data from cisco routers.

Thanks,

Mike


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue. 
::: Messages without supporting info will risk being sent to /dev/null



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list