check mrtg from bytes to bits

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
lesnikov
Posts: 25
Joined: Sat Jan 19, 2013 10:40 pm
Location: Slovenia

check mrtg from bytes to bits

Post by lesnikov »

Hi,

I'm using check_mrtg to get bandwidth/graphs from Cisco switch...
Result are shown in bytes (MB/s) and I would like them in bits? Is it possible?

conf:

Code: Select all

define command{
        command_name    check_local_mrtg
        command_line    $USER1$/check_mrtg -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
        }
define service{
        use                     generic-service ; Inherit values from a template
        host_name                       SW-10
        service_description     Port 25 Bandwidth Usage
        check_command           check_local_mrtgtraf!/var/www/mrtg/172.17.0.10_10125.log!AVG!1000000,2000000!5000000,5000000!10
        }

regards.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check mrtg from bytes to bits

Post by Box293 »

This is checking the file /var/www/mrtg/172.17.0.10_10125.log which is generated by MRTG.

Can you please post the MRTG config file for 172.17.0.10, it could be under /etc/mrtg perhaps
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
lesnikov
Posts: 25
Joined: Sat Jan 19, 2013 10:40 pm
Location: Slovenia

Re: check mrtg from bytes to bits

Post by lesnikov »

ok, i checked mrtg.cfg and there was everything in bytes. so i re run cfgmaker with bits

Code: Select all

cfgmaker --global 'WorkDir: /var/www/mrtg' --global 'Options[_]: bits' --output /etc/mrtg/mrtg3.cfg mokpr81@172.17.0.10:::::2
indexmaker --output=/var/www/mrtg/index.html /etc/mrtg/mrtg.cfg
and then checked again with nagios and it is shown with as bytes
Untitled.png
Untitled.png (7.54 KiB) Viewed 7457 times
MRTG config (after changed to bits)

Code: Select all

EnableIPv6: no
WorkDir: /var/www/mrtg
Options[_]: bits
Target[172.17.0.10_10102]: 10102:mokpr81@172.17.0.10:::::2
SetEnv[172.17.0.10_10102]: MRTG_INT_IP="" MRTG_INT_DESCR="GigabitEthernet1/0/2"
MaxBytes[172.17.0.10_10102]: 12500000
Title[172.17.0.10_10102]: Traffic Analysis for 10102 -- SW-10.slovenija.si
PageTop[172.17.0.10_10102]: <h1>Traffic Analysis for 10102 -- SW-10.slovenija.si</h1>
                <div id="sysdetails">
                        <table>
                                <tr>
                                        <td>System:</td>
                                        <td>SW-10.slovenija.si in </td>
                                </tr>
                                <tr>
                                        <td>Maintainer:</td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Description:</td>
                                        <td>GigabitEthernet1/0/2  </td>
                                </tr>
                                <tr>
                                        <td>ifType:</td>
                                        <td>ethernetCsmacd (6)</td>
                                </tr>
                                <tr>
                                        <td>ifName:</td>
                                        <td>Gi1/0/2</td>
                                </tr>
                                <tr>
                                        <td>Max Speed:</td>
                                        <td>100.0 Mbits/s</td>
                                </tr>
                        </table>
                </div>


User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check mrtg from bytes to bits

Post by Box293 »

You're on the right path, thats what needed to be updated first.

Your service is using the command definition check_local_mrtgtraf, can you post the command definition here please.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
lesnikov
Posts: 25
Joined: Sat Jan 19, 2013 10:40 pm
Location: Slovenia

Re: check mrtg from bytes to bits

Post by lesnikov »

copied first one by mistake... :

Code: Select all

define command{
        command_name    check_local_mrtgtraf
        command_line    $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
        }

./check_mrtgtraf --version
check_mrtgtraf v2.0.3 (nagios-plugins 2.0.3)

abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: check mrtg from bytes to bits

Post by abrist »

I believe this may be a limitation of check_mrtgtraf. From it's usage:
[snip]
If either the incoming or outgoing rates exceed the <icl> or <ocl> thresholds (in
Bytes/sec), a CRITICAL status results. If either of the rates exceed
the <iwl> or <owl> thresholds (in Bytes/sec), a WARNING status results.
[snip]
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
lesnikov
Posts: 25
Joined: Sat Jan 19, 2013 10:40 pm
Location: Slovenia

Re: check mrtg from bytes to bits

Post by lesnikov »

Yeah... Will have to chose different plugin to get what I need.

Thanks
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: check mrtg from bytes to bits

Post by jolson »

I see that your issue has been worked - I'll lock this forum post. Feel free to open another if you have additional issues. Thanks!

Best,


Jesse
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
Locked