SNMP and MRTG traffic statistics

Home Page Forums Network Management ZeroShell SNMP and MRTG traffic statistics

This topic contains 23 replies, has 0 voices, and was last updated by  imported_fulvio 2 years, 11 months ago.

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #41538

    imported_fulvio
    Participant

    The package http://www.zeroshell.net/listing/net-snmp-5.4.2.1-zs.tgz contains net-snmp binaries for Zeroshell. To install it use the following commands:

    cd /Database
    wget http://www.zeroshell.net/listing/net-snmp-5.4.2.1-zs.tgz
    tar xvfz net-snmp-5.4.2.1-zs.tgz

    This package could be included directly in the Zeroshell image, but before deciding to do that, I’d like to try using it to view graphic statistics about network traffic generated by MRTG.
    Could anyone post a valid snmp configuration to make Zeroshell able to answer to MRTG queries?

    Many thanks in advance.
    Fulvio

    #47784

    cylent
    Member

    ok so i install the package then how do we see the graphs? can you please give more detail?

    #47785

    ppalias
    Member

    My snmpd.conf file from a Slackware 12.0 server, with mrtg working fine.

    root@sardela:~# cat /etc/snmp/snmpd.conf
    ###########################################################################
    #
    # snmpd.conf
    #
    # - created by the snmpconf configuration program
    #
    ###########################################################################
    # SECTION: System Information Setup
    #
    # This section defines some of the information reported in
    # the "system" mib group in the mibII tree.

    # syslocation: The [typically physical] location of the system.
    # Note that setting this value here means that when trying to
    # perform an snmp SET operation to the sysLocation.0 variable will make
    # the agent return the "notWritable" error code. IE, including
    # this token in the snmpd.conf file will disable write access to
    # the variable.
    # arguments: location_string

    syslocation "Agia Paraskevi"

    # syscontact: The contact information for the administrator
    # Note that setting this value here means that when trying to
    # perform an snmp SET operation to the sysContact.0 variable will make
    # the agent return the "notWritable" error code. IE, including
    # this token in the snmpd.conf file will disable write access to
    # the variable.
    # arguments: contact_string

    syscontact "trendy "

    # sysservices: The proper value for the sysServices object.
    # arguments: sysservices_number

    sysservices 78

    ###########################################################################
    # SECTION: Access Control Setup
    #
    # This section defines who is allowed to talk to your running
    # snmp agent.

    # rouser: a SNMPv3 read-only user
    # arguments: user [noauth|auth|priv] [restriction_oid]

    rouser trendy noauth

    # rocommunity: a SNMPv1/SNMPv2c read-only access community name
    # arguments: community [default|hostname|network/bits] [oid]

    rocommunity trendy

    # rwcommunity: a SNMPv1/SNMPv2c read-write access community name
    # arguments: community [default|hostname|network/bits] [oid]

    #rwcommunity trendyrw localhost



    ###########################################################################
    # SECTION: Trap Destinations
    #
    # Here we define who the agent will send traps to.

    # trapcommunity: Default trap sink community to use
    # arguments: community-string

    trapcommunity public

    ###########################################################################
    # SECTION: Monitor Various Aspects of the Running Host
    #
    # The following check up on various aspects of a host.

    # proc: Check for processes that should be running.
    # proc NAME [MAX=0] [MIN=0]
    #
    # NAME: the name of the process to check for. It must match
    # exactly (ie, http will not find httpd processes).
    # MAX: the maximum number allowed to be running. Defaults to 0.
    # MIN: the minimum number to be running. Defaults to 0.
    #
    # The results are reported in the prTable section of the UCD-SNMP-MIB tree
    # Special Case: When the min and max numbers are both 0, it assumes
    # you want a max of infinity and a min of 1.

    proc sshd
    proc icecast 1 1
    proc ntpd 1 1
    proc httpd
    proc named 1 1
    proc dhcpd 1 1
    proc squid

    # disk: Check for disk space usage of a partition.
    # The agent can check the amount of available disk space, and make
    # sure it is above a set limit.
    #
    # disk PATH [MIN=100000]
    #
    # PATH: mount path to the disk in question.
    # MIN: Disks with space below this value will have the Mib's errorFlag set.
    # Can be a raw byte value or a percentage followed by the %
    # symbol. Default value = 100000.
    #
    # The results are reported in the dskTable section of the UCD-SNMP-MIB tree

    disk / 100000000
    disk /spare/storage1 100000000
    disk /spare/storage2 100000000
    disk /spare/storage3 100000000
    disk /spare/storage4 100000000
    disk /spare/storage5 100000000
    disk /var/squid 10000000
    disk /var/squid/cache1 10000000
    disk /var/squid/cache2 10000000
    disk /var/squid/cache3 10000000

    # load: Check for unreasonable load average values.
    # Watch the load average levels on the machine.
    #
    # load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0]
    #
    # 1MAX: If the 1 minute load average is above this limit at query
    # time, the errorFlag will be set.
    # 5MAX: Similar, but for 5 min average.
    # 15MAX: Similar, but for 15 min average.
    #
    # The results are reported in the laTable section of the UCD-SNMP-MIB tree

    load 75.0 65.0 50.0

    ###########################################################################
    # SECTION: Extending the Agent
    #
    # You can extend the snmp agent to have it return information
    # that you yourself define.

    # pass: Run a command that intepretes the request for an entire tree.
    # The pass program defined here will get called for all
    # requests below a certain point in the mib tree. It is then
    # responsible for returning the right data beyond that point.
    #
    # arguments: miboid program
    #
    # example: pass .1.3.6.1.4.1.2021.255 /path/to/local/passtest
    #
    # See the snmpd.conf manual page for further information.
    #
    # Consider using "pass_persist" for a performance increase.
    pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat

    Of course many of these things are not necessary as they monitor disk space, processes active but in general having a contact name, system location, rouser and rocommunity should do the job.

    #47786

    cylent
    Member

    Thats great but i dont see no start script in /etc/init.d or anything

    how do i start the snmpd deamon?

    also, where is the snmpd.conf file located in ZS?

    #47787

    glippi
    Member

    I got the same thing.
    I am running zeroshell img from harddrive and I would like to monitor user traffic per ip on the network.

    I installed as described above, rebooted the server, but still have no access to any of the snmp features.

    My conf is located in “/DB/_DB.003/opt/x.x/packages/sbin/snmpd”


    root@palaimon net-snmp> cat snmpd.conf
    #
    # net-snmp (or ucd-snmp) persistent data file.
    #
    ############################################################################
    # STOP STOP STOP STOP STOP STOP STOP STOP STOP
    #
    # **** DO NOT EDIT THIS FILE ****
    #
    # STOP STOP STOP STOP STOP STOP STOP STOP STOP
    ############################################################################
    #
    # DO NOT STORE CONFIGURATION ENTRIES HERE.
    # Please save normal configuration tokens for snmpd in SNMPCONFPATH/snmpd.conf.
    # Only "createUser" tokens should be placed here by snmpd administrators.
    # (Did I mention: do not edit this file?)
    #















    usmUser * (purposely blanked)
    setserialno * (purposely blanked)
    ##############################################################
    #
    # snmpNotifyFilterTable persistent data
    #
    ##############################################################


    ##############################################################
    #
    # ifXTable persistent data
    #
    ifXTable .1 14:0 18:0x $
    ifXTable .2 14:0 18:0x $
    ifXTable .3 14:0 18:0x $
    ifXTable .4 14:0 18:0x $
    ifXTable .5 14:0 18:0x $
    ifXTable .8 14:0 18:0x $
    ##############################################################


    engineBoots 3
    oldEngineID 0x80001f88805d29c229741bb849

    So tell me….. since I am not a master in this (yet!?) 🙂
    What do you want me to do now? 🙂

    #47788

    glippi
    Member

    I see i have a few more in different locations (quickly scrolling)

    Advice please! 🙂

    #47789

    redtdi
    Member

    Hi Fulvio:

    Have you been able to get SNMP to work with ZeroShell yet? I would love to use this feature once you have the bugs worked out.

    Thanks,
    Ken

    #47790

    tamws
    Member

    For me, I follow these steps:

    1. I use the config file example from ppalias, put it into /Database/opt/x.x/packages/share/snmp/snmpd.conf

    2. and then add these lines to the “Post Boot” startup script:
    # Start the SNMP Service
    SNMPCONFPATH=/Database/opt/x.x/packages/share/snmp/
    /Database/opt/x.x/packages/sbin/snmpd

    It may not be a good method, but it works for me at this moment! The snmp service will auto run when the zeroshell start, and I can query the snmp values from a remote host.

    #47791

    tekoholic
    Member

    OK, so how’s about a Nagios Plugin Template? I’m no expert, and try as I might, I can’t seem to figure out how to create…

    #47792

    micampo
    Member

    alguein has pictures of the information that is gathered with snmp support?

    to motivate me to mount it on the release 13

    #47793

    houkouonchi
    Member

    The snmp.conf can be very simple, For example mine is just:


    com2sec local 127.0.0.1/32 public

    group MyROGroup v1 local
    group MyROGroup v2c local
    group MyROGroup usm local

    view all included .1 80

    access MyROGroup "" any noauth exact all none none

    syslocation MyLocation
    syscontact Me

    So its only accessible from localhost.

    I have MRTG and SNMP working fine on my ZS box:

    http://fios1.houkouonchi.jp/mrtg/
    http://fios2.houkouonchi.jp/mrtg/

    #47794

    Findarato
    Member

    I am currently using the

    1. I use the config file example from ppalias, put it into /Database/opt/x.x/packages/share/snmp/snmpd.conf

    2. and then add these lines to the “Post Boot” startup script:
    # Start the SNMP Service
    SNMPCONFPATH=/Database/opt/x.x/packages/share/snmp/
    /Database/opt/x.x/packages/sbin/snmpd

    Except I used the config from houkouonchi.

    I can see the script start, but I can not query it for any results. my config file is located /Database/opt/x.x/packages/share/snmp/snmpd.conf

    #47795

    ppalias
    Member

    Can’t you query locally or remotely? If it is the latter, check the firewall.

    #47796

    Findarato
    Member

    I can not poll it either.

    I do not get any error messages in start up scripts so I am assuming its running.

    #47797

    ppalias
    Member

    Is it really running?

    netstat -anp | grep 161

    What does it show?

Viewing 15 posts - 1 through 15 (of 25 total)

You must be logged in to reply to this topic.