SNMP extensions user guide


SNMP extensions user guide


The following howto meant to help you understand Allprobe extensions structure, change extensions behavior and configure your own extensions located on your own repositories.


Extensions name format:


The name of the extension control the extension params, for exmaple:


Extension name - "APR-vmstat-cs" would mean


APR - extensions type (APR=allprobe, USR=user defined extension)

vmstat - the extension subject or set of values, this part also states the file name of the pulled extension,

So in this case if running the integrator, the exension will be pulled from allprobe repository


and be placed at /etc/apr/snmp/system/


Then pull


and be placed at /etc/apr/cron/system/


then configure the cron (this is cron based extension)


* * * * * root /bin/bash -c "/etc/apr/cron/system/; sleep 30 ; /etc/apr/cron/system/"


Configure SNMP configuration (e.g: /etc/snmp/snmpd.conf) by placing each extension as new extension, in this case:


extend APR-vmstat-cs /etc/apr/snmp/system/ cs


The value produced in this extension is the output of the command:


/etc/apr/snmp/system/ cs


The argument "cs" is the third part of the extension name.


Other extensions options:

The following values can be configured for each extensions.





* Croned / Not Croned:


Extensions supports 3 cron mode types:


1 - Not croned - There is no cron to support the CLI command run by SNMP daemon


2 - One cron foreach grouped category, there is a cron for each subject such as vmstat, there is 1 cron that producing all of the vmstat extensions values

So in the vmstat example there is many values produced by the cron and the CLI run from the SNMP daemon as extension will fetch each value with different argument, APR-vmstat-cs will get "Context Switches" , APR-vmstat-interrupts will get Interrupts


3 - Lang - Lang of the extension code / Python, Perl, Bash, PHP - control the file extension and the way the extension will be running(default mode is bash, file extension sh)


4 - URL - The repository of the extension - default value if not set is

So in the extension name "APR-vmstat-cs" which is croned (grouped type) and lang "BASH" the files fetched by the integrator or manualy will be


If you place it manualy then snmp file will have to go to:




and the cron file will be placed at:




Creating your own extensions:


1 - Need to decide the cron type of the extension


None croned, grouped cron, single cron


You set this by the exnesion properties. if we take the example extension vmstat mensioned above it is cron type of "grouped"

The vmstat extension based on the output of the vmstat command which has many values, we can re-use all of this values

In different argument passed by SNMP daemon.


The cron is configured to run once every 30 seconds by the integrator or manualy, then output is beeing written to a buffer file at:



The CLI that the SNMP daemon is calling is



Which is a simple BASH script that uses the buffer file created by the cron, thus just fast open with FS cache




case $1 in
        CMD=`cat $BUFFER/vmstat | awk '{print $13}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $14}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $15}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $16}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $12}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $11}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $7}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $8}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $9}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $10}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $1}'`
        CMD=`cat $BUFFER/vmstat | awk '{print $2}'`
        echo "Unknown argument"


if [ $? -eq 0 ]; then
    echo $OUTPUT
    echo "0"


The extension would then look like that on snmpd.conf when all uses the same script that uses the same buffer with category's values pre fetched:


extend APR-vmstat-so /etc/apr/snmp/system/ so
extend APR-vmstat-watime /etc/apr/snmp/system/ watime
extend APR-vmstat-user /etc/apr/snmp/system/ user
extend APR-vmstat-system /etc/apr/snmp/system/ system
extend APR-vmstat-running /etc/apr/snmp/system/ running
extend APR-vmstat-si /etc/apr/snmp/system/ si
extend APR-vmstat-bo /etc/apr/snmp/system/ bo
extend APR-vmstat-interrupts /etc/apr/snmp/system/ interrupts
extend APR-vmstat-blocked /etc/apr/snmp/system/ blocked
extend APR-vmstat-cs /etc/apr/snmp/system/ cs
extend APR-vmstat-bi /etc/apr/snmp/system/ bi


If it is user defined exension, simply replace APR with USR short for USER on the exension name,

The files of the exnesion(exension and / or cron) scripts are also placed in user folders e.g






Helpful Resources