Sending traps - SNMP

This is a discussion on Sending traps - SNMP ; There MUST be an application which offers the reading of a MIB-value (like snmpget), subsequent comparison to given intervals and finally (given the result) sending a trap. Nils...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Sending traps

  1. Sending traps

    There MUST be an application which offers the reading of a MIB-value
    (like snmpget), subsequent comparison to given intervals and finally
    (given the result) sending a trap.

    Nils

  2. Re: Sending traps

    Nils wrote:
    > There MUST be an application which offers the reading of a MIB-value
    > (like snmpget), subsequent comparison to given intervals and finally
    > (given the result) sending a trap.


    Not that I know of offhand, but it should be only a trivimal script:

    #!/bin/sh

    host=$1 oid=$1 min=$3 max=$4 traphost=$5 trapoid=$6
    value=`snmpget -Oqv $host $oid`
    [ $value -ge $min ] || snmptrap $traphost '' $trapoid $oid = $value
    [ $value -le $max ] || snmptrap $traphost '' $trapoid $oid = $value

    exit 0

    The above is of course untested :-)

    /Niels

    --
    Niels Baggesen -- @home -- Århus -- Denmark -- niels@baggesen.net
    The purpose of computing is insight, not numbers -- R W Hamming

+ Reply to Thread