About:

getsnmp is a scheduler for collect snmp values from any network equipment and store it into a rrdtool database.

News:

  • version 0.11: (12/02/2009)
    FEAT: can use 64 bit counters
    FEAT: permit to specify global data filename. this is new inherited value
    FEAT: increase error log verbosity
    FEAT: dont quit program if select return an error. try to resolve error.
    FEAT: log warning if negative timeout is encoutered
    CLEANUP: code reorganization
    CLEANUP: normalize comments
    CLEANUP: remove unused debug info
    BUG: major: fix scheduler loop bug. When getsnmp do send at least two snmp request at the same hosts, and this does not respond, the snmp timeout cause bug in scheduler.
    BUG: minor: check for microseconds overflow (> 1000000) after adding 2 dates
    BUG: minor: fix bug into negative time detection
    BUG: minor: log real getsnmp version
    BUG: minor: error in rotate value interpretation
    BUG: minor: bug in displaying rotate filenames
    BUG: minor: Use defines around rrd initialization string. this initialization is not necessary if rrdtool is not compiled in
    BUG: minor: twice buffer initialization
  • version 0.10: (06/02/2009)
    can display expanded conf ( -s )
    BUGFIX: memory crush
  • version 0.9: (09/09/2008)
    By Lucian Craciun: FreeBSD bug in the sheduler
  • version 0.8: (20/02/2008)
    can add specific mib directorys
    log in all cases
    minor bug: segfault in some cases when loading configuration
  • version 0.7: (01/05/2008)
    permit rotation when the filename is in the get section
  • version 0.6: (17/12/2007)
    can add specific mib directorys
    log in all cases
    permit rotation when the filename is in the get section
    minor bug: segfault in some cases when loading configuration
  • version 0.6: (17/12/2007)
    extend configuration file possibilities for making this more simply
  • version 0.5: (03/12/2007)
    Prevent segfault in error log
  • version 0.4: (01/12/2007)
    OpenBSD port
    data files rotation
    can add a global data filename prefix
    limit number of oids requested in one paquet snmp
    Segfault when the conf is parsed if DNS resolution failed.
    use unsigned int in file values
    dont quit in error case
    generate warning when parse config file
    Doc
  • version 0.3: (04/05/2007)
    the snmp values can be stored in a log file
    you can compile the project without rrdtool
    bug in install script
  • version 0.2: (25/04/2007)
    error while reading config file
  • version 0.1b (beta): (06/02/2007)
    init db files after chrooting
    implement basic -h option command line
    man writted
  • version 0.0b (beta): (05/02/2007)
    initial release

Doc (0.11):

global config section:

COMMAND LINE

-h help
Comma separated network interfaces listen to.

-f config_file
Specify the config file.

-D log level required


-d run as daemon


-v version


CONFIG FILE

directorydb <directory>
store rrdtool db files into this directory

lockfile <pidfile>
file used for store pid number and lock the process

daemon (yes|no)
run in daemon mode (fork) ?

umask umask
mask creation file

user user
user running application

chrootdir <path>
directory to chroot application

loglevel (0|1|2|3|4|5|6|7)
log with this level
0: emergency
1: alert
2: critical
3: error
4: warning
5: notice
6: info
7: debug

usesyslog (yes|no)
use syslog

logfile <logfile>
log in this file

max_oid_in_one_request 0..n
limit the number of oid requested in one request snmp a big number of oid requested not contain in one udp paquet
the default is 30

retrieve data section:

global community community
set the default community
the default unsetted is 'public'

global inter seconds
set the default interval among two snmp get
the default unsetted is '300'

global retry number
set the default number of retry
the default unsetted is '0'

global timeout seconds
set the default request timeout (in seconds)
the default unsetted is '3'

global version (v1|v2|v2c)
set the default snmp protocol version
the default value unsetted is 'v1'

global backends (rrd|file)
set the defaults backends for recording values. the default is rrd only.
global rotate (no|seconds 0..n)
rotate file time ("no" for disabled) default no
global prefix string
prefix data file default ""
global filename string
set default data file no default
set
the keyword "set" set a snmp host server:

example:
set version v2c ip 192.168.10.4 timeout 3 retry 2 community public

the option are:
* ipserver ip (must informed)
interinterval among two snmp get (default: "global inter")
versionsnmp protocol version (default: "global version")
timeoutrequest timeout (default: "global timeout")
retrynumber of retry (default: "global retry")
communitycommunity (default: "global community")
backend_rrddefault rrd backend (default: "global backends")
backend_filedefault file backend (default: "global backends")
rotateset rotation system time ("no" for disabled) (default: "global rotate")
prefixset prefix for data file (default: "global prefix")
filenamethe snmp values file (default: "global filename")
( * ) must informed
get
the "get" keyword is used for declaring one snmp value:

example:
get oid IF-MIB::ifInOctets.3 inter 5 file toto type gauge

the option are:
* oid SNMPv2-MIB::sysDescr.0the oid name. For making configuration easy, the OID name can be extended. Ex: IF-MIB::if{In,Out}{Octets,Errors}.{1-24}. the parameters filaname, dataname and file can be match this variables with this syntax , , ... (this parameter must informed)
interinterval among two snmp get (default: inherited from the last set)
filethe db rrdtool file (default: automaticaly generated from OID)
filenamethe snmp values file (default: automaticaly generated from OID)
datanamethe name of the data getted (default: automaticaly generated from OID)
type gaugetype of rrdtool data (gauge, counter) (default: gauge)
timeoutrequest timeout (default: inherited from the last set)
retrynumber of retry (default: inherited from the last set)
backend_rrddefault rrd backend (default: inherited from the last set)
backend_filedefault file backend (default: inherited from the last set)
rotateset rotation system time ("no" for disabled) (default: inherited from the last set)
prefixset prefix for data file (default: inherited from the last set)
filenamethe snmp values file (default: inherited from the last set if no filename inherited, is automaticaly generated)
( * ) must informed

examples:

###################################################
# router
###################################################
set ip 192.168.10.1
# vlan0
get oid IF-MIB::ifInOctets.3 type counter
get oid IF-MIB::ifOutOctets.3 type counter
# vlan1
get oid IF-MIB::ifInOctets.4 type counter
get oid IF-MIB::ifOutOctets.4 type counter
# vlan2
get oid IF-MIB::ifInOctets.5 type counter
get oid IF-MIB::ifOutOctets.5 type counter
# tun0
get oid IF-MIB::ifInOctets.7 type counter
get oid IF-MIB::ifOutOctets.7 type counter
# tun1
get oid IF-MIB::ifInOctets.6 type counter
get oid IF-MIB::ifOutOctets.6 type counter
# cpu user / nice / system
get oid UCD-SNMP-MIB::ssCpuRawUser.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawNice.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawSystem.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawIdle.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawKernel.0 type counter
# mem
get oid UCD-SNMP-MIB::memTotalReal.0 type gauge
get oid UCD-SNMP-MIB::memAvailReal.0 type gauge
get oid UCD-SNMP-MIB::memCached.0 type gauge


###################################################
# server
###################################################
set ip 192.168.10.2
get oid IF-MIB::ifInOctets.2 type counter
get oid IF-MIB::ifOutOctets.2 type counter
# cpu user / nice / system
get oid UCD-SNMP-MIB::ssCpuRawUser.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawNice.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawSystem.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawIdle.0 type counter
get oid UCD-SNMP-MIB::ssCpuRawKernel.0 type counter
# mem
get oid UCD-SNMP-MIB::memTotalReal.0 type gauge
get oid UCD-SNMP-MIB::memAvailReal.0 type gauge
get oid UCD-SNMP-MIB::memCached.0 type gauge
# disque
get oid HOST-RESOURCES-MIB::hrStorageUsed.7 type gauge
    

Downloads:

FileMD5Sum
getsnmp-0.11.tar.gz2b28cab1a112bf884c003a12c756dd9f
getsnmp-0.10.tar.gz- Availaible on demand -
getsnmp-0.9.tar.gz- Availaible on demand -
getsnmp-0.8.tar.gz- Availaible on demand -
getsnmp-0.7.tar.gz- Availaible on demand -
getsnmp-0.6.tar.gz- Availaible on demand -
getsnmp-0.5.tar.gz- Availaible on demand -
getsnmp-0.4.tar.gz- Availaible on demand -
getsnmp-0.3.tar.gz- Availaible on demand -
getsnmp-0.2.tar.gz- Availaible on demand -
getsnmp-0.1b.tar.gz- Availaible on demand -
getsnmp-0.0b.tar.gz- Availaible on demand -

Contact

Author: Thierry FOURNIER
EMail: