Results 1 to 8 of 8
  1. #1
    Untangler swmspam's Avatar
    Join Date
    Mar 2008
    Posts
    73

    Default HowTo: MRTG performance graphs

    I use MRTG (Multi Router Traffic Grapher) found http://oss.oetiker.ch/mrtg/ to monitor various systems. Since Untangle 6.1 has SNMP easily available, why not?

    Warning! MRTG runs on a separate machine. The only thing you need on the Untangle box is enable SNMP. The rest of the configuration is on the other machine that collects the data. It's possible to setup MRTG in the UT box, but that's outside of the scope of this howto.

    Here's what I did:

    1. Enable SNMP using the UT 6.1 web interface. Go to Administration -> Monitoring -> Enable SNMP. For "community", I use 12-character strong names. I use an online password creator to make the crazy names. http://www.pctools.com/guides/password/

    2. Hmmm, that didn't work so well. Maybe I did something wrong. The SNMP setup with the UT web-based configuration seemed a little limited, so I looked at the snmpd.conf file and made my own adjustments:
    Code:
    nano /etc/snmp/snmpd.conf
    Code:
    com2sec readonly  default       gRuyEr7e5eho
    com2sec readwrite 127.0.0.1     RjJ7uFrWJajD
    com2sec paranoid  default       KrwPha4u2HAh
    group MyROGroup v1         readonly
    group MyROGroup v2c        readonly
    group MyROGroup usm        readonly
    group MyRWGroup v1         readwrite
    group MyRWGroup v2c        readwrite
    group MyRWGroup usm        readwrite
    group MyROSystem v1        paranoid
    group MyROSystem v2c       paranoid
    group MyROSystem usm       paranoid
    
    view all    included  .1                               80
    view system included  .iso.org.dod.internet.mgmt.mib-2.system
    access MyROSystem ""     any       noauth    exact  system none   none
    access MyROGroup ""      any       noauth    exact  all    none   none
    access MyRWGroup ""      any       noauth    exact  all    all    none
    syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
    syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
    proc mountd
    proc ntalkd 4
    proc sendmail 10 1
    disk /       10000
    load 12 14 14
    Now restart the SNMPd
    Code:
    /etc/init.d/snmpd restart
    3. On a seperate machine running MRTG, edit the mrtg configuration file. In this example, the Untangle machine is 192.168.13.2 with the community name of gRuyEr7e5eho (as defined above).
    Code:
    nano /etc/mrtg.cfg
    Code:
    ######################################################################
    # System: Untangle
    ######################################################################
    
    Target[Untangle.memreal]: .1.3.6.1.4.1.2021.4.6.0&.1.3.6.1.4.1.2021.4.6.0:gRuyEr7e5eho@192.168.13.2
    PageTop[Untangle.memreal]: <H1>Untangle Real Free Memory</H1>
    Options[Untangle.memreal]: nopercent,growright,gauge,noinfo,pngdate
    Title[Untangle.memreal]: Untangle Free Memory
    MaxBytes[Untangle.memreal]: 1000000000000
    kMG[Untangle.memreal]: k,M,G,T,P,X
    YLegend[Untangle.memreal]: Memory
    ShortLegend[Untangle.memreal]: bytes
    LegendI[Untangle.memreal]: Total Free:
    Legend2[Untangle.memreal]:
    LegendO[Untangle.memreal]: Total Free:
    Legend1[Untangle.memreal]: Real Free Memory, in bytes
    
    Target[Untangle.membuffer]: .1.3.6.1.4.1.2021.4.14.0&.1.3.6.1.4.1.2021.4.14.0:gRuyEr7e5eho@192.168.13.2
    PageTop[Untangle.membuffer]: <H1>Untangle Buffered Memory</H1>
    Options[Untangle.membuffer]: nopercent,growright,gauge,noinfo,pngdate
    Title[Untangle.membuffer]: Untangle Buffered Memory
    MaxBytes[Untangle.membuffer]: 1000000000000
    kMG[Untangle.membuffer]: k,M,G,T,P,X
    YLegend[Untangle.membuffer]: Memory
    ShortLegend[Untangle.membuffer]: bytes
    LegendI[Untangle.membuffer]: Total Free:
    Legend2[Untangle.membuffer]:
    LegendO[Untangle.membuffer]: Total Free:
    Legend1[Untangle.membuffer]: Buffered Memory, in bytes
    
    Target[Untangle.memcached]: .1.3.6.1.4.1.2021.4.15.0&.1.3.6.1.4.1.2021.4.15.0:gRuyEr7e5eho@192.168.13.2
    PageTop[Untangle.memcached]: <H1>Untangle Cached Memory</H1>
    Options[Untangle.memcached]: nopercent,growright,gauge,noinfo,pngdate
    Title[Untangle.memcached]: Untangle Cached Memory
    MaxBytes[Untangle.memcached]: 1000000000000
    kMG[Untangle.memcached]: k,M,G,T,P,X
    YLegend[Untangle.memcached]: Memory
    ShortLegend[Untangle.memcached]: bytes
    LegendI[Untangle.memcached]: Total Free:
    Legend2[Untangle.memcached]:
    LegendO[Untangle.memcached]: Total Free:
    Legend1[Untangle.memcached]: Cached Memory, in bytes
    
    Target[Untangle.dsktable]: .1.3.6.1.4.1.2021.9.1.7.2&.1.3.6.1.4.1.2021.9.1.7.2:gRuyEr7e5eho@192.168.13.2
    MaxBytes[Untangle.dsktable]: 200000000
    Title[Untangle.dsktable]: Untangle Disk Free Space
    PageTop[Untangle.dsktable]: <H1>Untangle Disk Free Space</H1>
    Unscaled[Untangle.dsktable]: ymwd
    ShortLegend[Untangle.dsktable]: B
    kMG[Untangle.dsktable]: k,M,G,T,P
    kilo[Untangle.dsktable]: 1024
    YLegend[Untangle.dsktable]: Free Space
    Legend1[Untangle.dsktable]: Free Space (hda1)
    Legend2[Untangle.dsktable]:
    Legend3[Untangle.dsktable]:
    Legend4[Untangle.dsktable]:
    LegendI[Untangle.dsktable]: Free Space:
    LegendO[Untangle.dsktable]: Free Space:
    Options[Untangle.dsktable]: growright,gauge,nopercent,pngdate
    
    Target[Untangle.loadaverage]: .1.3.6.1.4.1.2021.10.1.3.3&.1.3.6.1.4.1.2021.10.1.3.2:gRuyEr7e5eho@192.168.13.2 * 100
    MaxBytes[Untangle.loadaverage]: 200
    Title[Untangle.loadaverage]: Untangle Load Average (x100)
    PageTop[Untangle.loadaverage]: <H1>Untangle CPU Load Average (x100)</H1>
    # Unscaled[Untangle.loadaverage]: ymwd
    ShortLegend[Untangle.loadaverage]: x100
    YLegend[Untangle.loadaverage]: Load Average
    Legend1[Untangle.loadaverage]: Load Average 15 min
    Legend2[Untangle.loadaverage]: Load Average 5 min
    LegendI[Untangle.loadaverage]: 15min load
    LegendO[Untangle.loadaverage]: 5min load
    Options[Untangle.loadaverage]: growright,gauge,nopercent,pngdate,logscale
    
    Target[Untangle_2]: 2:gRuyEr7e5eho@192.168.13.2:
    SetEnv[Untangle_2]: MRTG_INT_IP="192.168.13.2" MRTG_INT_DESCR="eth0"
    MaxBytes[Untangle_2]: 1250000
    Title[Untangle_2]: Untangle eth0
    PageTop[Untangle_2]: <h1>Untangle eth0</h1>
                    <div id="sysdetails">
                            <table>
                                    <tr>
                                            <td>Description:</td>
                                            <td>eth0  </td>
                                    </tr>
                                    <tr>
                                            <td>ifName:</td>
                                            <td>eth0</td>
                                    </tr>
                                    <tr>
                                            <td>Max Speed:</td>
                                            <td>10.0 Mbits/s</td>
                                    </tr>
                                    <tr>
                                            <td>Ip:</td>
                                            <td>192.168.13.2()</td>
                                    </tr>
                            </table>
                    </div>
    
    Target[Untangle_3]: 3:gRuyEr7e5eho@192.168.13.2:
    SetEnv[Untangle_3]: MRTG_INT_IP="192.168.13.2" MRTG_INT_DESCR="eth1"
    MaxBytes[Untangle_3]: 1250000
    Title[Untangle_3]: Untangle eth1
    PageTop[Untangle_3]: <h1>Untangle eth1</h1>
                    <div id="sysdetails">
                            <table>
                                    <tr>
                                            <td>Description:</td>
                                            <td>ham0  </td>
                                    </tr>
                                    <tr>
                                            <td>ifName:</td>
                                            <td>ham0</td>
                                    </tr>
                                    <tr>
                                            <td>Max Speed:</td>
                                            <td>10.0 Mbits/s</td>
                                    </tr>
                                    <tr>
                                            <td>Ip:</td>
                                            <td>192.168.13.2()</td>
                                    </tr>
                            </table>
                    </div>
    Taa daa! Manually kill and restart mrtg. Remember, MRTG doesn't actually run on the UT box. The only time you touch the UT box is to get SNMPd running. I usually run mrtg in daemon mode.

    Code:
    env LANG=C /usr/bin/mrtg
    It's possible to run MRTG on the UT box, so you don't need a separate machine to perform the datalogging and graphing, but it's a bit more difficult.

    See pictures for example outputs. The big change at 22:00 is rebooting. That's why the cached memory and buffered memory reset. With a little trickery, you can also datalog CPU temperatures using SNMP linked to LM_Sensors, swap file usage, and other good stuff. Yahoo.
    Last edited by swmspam; 05-01-2009 at 11:47 AM.

  2. #2
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    431

    Default

    very nice. I will try this tomorrow.

    BTW, has ayone have nagios monitoring a UT box? I have both mrtg and nagios running on a seperate box and would really like to get paged if something went "weird"
    Last edited by wharfratjoe; 05-02-2009 at 01:18 AM.

  3. #3
    Master Untangler li_leejohn's Avatar
    Join Date
    Sep 2008
    Posts
    253

    Default

    I used cacti to monitor my UT box

  4. #4
    Untangle Ninja mrunkel's Avatar
    Join Date
    Jul 2008
    Posts
    3,040

    Default

    we use cacti, munin, and nagios to monitor our untangle in the office.

    All work great. NRPE is installed as well as the stock debian munin-node package.
    m.


    Big Frickin Disclaimer:
    While I'm pretty sure, I can't guarantee that I know what I'm doing. There might be a better way to do this, and this way might actually suck. Make sure you understand the implications of what you're doing before trying to follow these directions.

    It often helps troubleshooting if you have a good network map. Look here if you want my advice on how to draw one.
    Attention: Support and help on the Untangle Forums is provided by volunteers and community members like yourself.
    If you need Untangle support please call or email support@untangle.com

  5. #5
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    431

    Default

    first i want to say thank you for the very easy HOWTO.

    I had to change the OID for Free Disk Space due to the following errors I was getting:

    2009-05-02 11:25:47 -- SNMPGET Problem for .1.3.6.1.4.1.2021.9.1.7.2 .1.3.6.1.4.1.2021.9.1.7.2 sysUptime sysName on ************@untangle::::::v4only
    at mrtg line 2202
    2009-05-02 11:25:47 -- 2009-05-02 11:25:47: ERROR: Target[untangle.dsktable][_IN_] ' $target->[6]{$mode} ' did not eval into defined data
    2009-05-02 11:25:47 -- 2009-05-02 11:25:47: ERROR: Target[untangle.dsktable][_OUT_] ' $target->[6]{$mode} ' did not eval into defined data

    NEW OID
    Target[Untangle.dsktable]: .1.3.6.1.4.1.2021.9.1.7.1&.1.3.6.1.4.1.2021.9.1.7.1:*************@untangle

    Once that was changed and mrtg was reloaded, all the other graphs started to populate

    (I referenced http://www.debianhelp.co.uk/linuxoids.htm for the OID's)
    Last edited by wharfratjoe; 05-02-2009 at 12:01 PM.

  6. #6
    Master Untangler li_leejohn's Avatar
    Join Date
    Sep 2008
    Posts
    253

    Default

    good reference over there.

  7. #7
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    431

    Default

    Is very happy with MRTG and nagios (nrpe) monitoring a UT box...OH YEAH!

  8. #8
    Master Untangler wharfratjoe's Avatar
    Join Date
    Dec 2008
    Location
    Southern California
    Posts
    431

    Default

    Packet filter (running in router-mode) to monitor UT from a external MRTG/SNMP device.



    Code:
    Name: Allow snmp to untangle external interface
    Action: Pass
    Source Address: MRTG/SNMP_server_ip (This will be your WAN ip for your MRTG Server)
    Destination Address: External_UT_IP
    Destinal Port: 161
    Source Interface: External
    Destined Local
    Protocol: UDP
    To verify you are connecting via snmp run the following from the UT box:

    Code:
    tcpdump udp dst port 161
    Last edited by wharfratjoe; 05-05-2009 at 11:02 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2