Page 1 of 1

check mrtg from bytes to bits

Posted: Tue Feb 17, 2015 7:30 pm
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.

Re: check mrtg from bytes to bits

Posted: Tue Feb 17, 2015 9:47 pm
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

Re: check mrtg from bytes to bits

Posted: Tue Feb 17, 2015 10:39 pm
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 [email protected]:::::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 8564 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:[email protected]:::::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>



Re: check mrtg from bytes to bits

Posted: Tue Feb 17, 2015 10:56 pm
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.

Re: check mrtg from bytes to bits

Posted: Tue Feb 17, 2015 11:01 pm
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)


Re: check mrtg from bytes to bits

Posted: Thu Feb 19, 2015 2:56 pm
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]

Re: check mrtg from bytes to bits

Posted: Sun Feb 22, 2015 12:31 pm
by lesnikov
Yeah... Will have to chose different plugin to get what I need.

Thanks

Re: check mrtg from bytes to bits

Posted: Mon Feb 23, 2015 5:00 pm
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