running a command when there is a problem with proces - SNMP

This is a discussion on running a command when there is a problem with proces - SNMP ; Hi all. Im am checking the apache2 proces but my procfix does not get executed when I do snmpwalk I get this UCD-SNMP-MIB: rErrMessage.1 = STRING: No apache2 process running. UCD-SNMP-MIB: rErrorFlag.1 = INTEGER: error(1) UCD-SNMP-MIB: rErrFix.1 = INTEGER: noError(0) ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: running a command when there is a problem with proces

  1. running a command when there is a problem with proces

    Hi all.
    Im am checking the apache2 proces but my procfix does not get executed
    when I do snmpwalk I get this

    UCD-SNMP-MIB:rErrMessage.1 = STRING: No apache2 process running.
    UCD-SNMP-MIB:rErrorFlag.1 = INTEGER: error(1)
    UCD-SNMP-MIB:rErrFix.1 = INTEGER: noError(0)

    this my snmpd.conf:


    group MyROSystem v1 paranoid
    group MyROSystem v2c readonly
    group MyROSystem usm paranoid
    group MyROGroup v1 readonly
    group MyROGroup v2c readonly
    group MyROGroup usm readonly
    group MyRWGroup v1 readwrite
    group MyRWGroup v2c readwrite
    group MyRWGroup usm readwrite

    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 "DATA STORE"

    syscontact noc@mydomain.ldt

    sysservices 13
    proc apache2
    procfix apache2 /etc/init.d/apache2 restart

    disk /boot 100000
    load 25 10 5

    trap2sink 212.44.224.31 public

    rocommunity public
    createUser internalUse
    rouser internalUse
    iquerySecName internalUse
    monitor -r 80 -o prNames -o prErrMessage "procTable" prErrorFlag != 0
    monitor -r 80 -o memErrorName -o memSwapErrorMsg "memory" memSwapError != 0
    monitor -r 80 -o extNames -o extOutput "extTable" extResult != 0
    monitor -r 10 -o dskPath -o dskAvail -o dskTotal "dskTable "
    dskErrorFlag 0 1
    monitor -r 80 -o laNames -o laErrMessage "laTable" laErrorFlag != 0
    monitor -r 80 -o fileName -o fileErrorMsg "fileTable" fileErrorFlag != 0


    Any idea??
    Thank

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-users mailing list
    Net-snmp-users@lists.sourceforge.net
    Please see the following page to unsubscribe or change other options:
    https://lists.sourceforge.net/lists/...net-snmp-users


  2. Re: running a command when there is a problem with proces

    2008/7/31 Osvaldo Alvarez Pozo :
    > Im am checking the apache2 proces but my procfix does not get executed


    You need to action this yourself - either directly:

    $ snmpset .... prErrFix i 1


    or via a suitable monitor/setEvent combination:

    setEvent caniPressTheButtonAgain prErrFix = 1
    monitor -e caniPressTheButtonAgain "watch the prTable" prErrorFlag != 0

    (Note - not actually tested, but I think it should work)

    Dave

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-users mailing list
    Net-snmp-users@lists.sourceforge.net
    Please see the following page to unsubscribe or change other options:
    https://lists.sourceforge.net/lists/...net-snmp-users


  3. Fwd: running a command when there is a problem with proces

    ---------- Forwarded message ----------
    From: Osvaldo Alvarez Pozo
    Date: Fri, Aug 1, 2008 at 12:09 PM
    Subject: Re: running a command when there is a problem with proces
    To: Dave Shield


    I modified my snmpd.conf like this.
    setEvent ProcessusError prErrFix = 1
    monitor -r 10 -e ProcessusError -o prNames -o prErrMessage
    "procTable" prErrorFlag != 0


    And nothing happens, I do not get my trap either
    are the "-o" and " -e" options exclusifs???

    Thanks

    On Fri, Aug 1, 2008 at 12:45 AM, Dave Shield wrote:
    > 2008/7/31 Osvaldo Alvarez Pozo :
    >> Im am checking the apache2 proces but my procfix does not get executed

    >
    > You need to action this yourself - either directly:
    >
    > $ snmpset .... prErrFix i 1
    >
    >
    > or via a suitable monitor/setEvent combination:
    >
    > setEvent caniPressTheButtonAgain prErrFix = 1
    > monitor -e caniPressTheButtonAgain "watch the prTable" prErrorFlag != 0
    >
    > (Note - not actually tested, but I think it should work)
    >
    > Dave
    >


    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-users mailing list
    Net-snmp-users@lists.sourceforge.net
    Please see the following page to unsubscribe or change other options:
    https://lists.sourceforge.net/lists/...net-snmp-users


  4. Re: running a command when there is a problem with proces

    Hi all
    I continue with my problem of procfix.
    IF I use snmpset to set UCD-SNMP-MIB:rErrFix.1 apache2 get started.
    I putted this command in a cron job but I can take a minute before
    starting apache2. That'is why I am interested on using SetEvent to
    set prErrFix to 1.
    I do not understand why a feature described in the man , does not work
    in reality.

    Any Idea??

    Thanks

    On Fri, Aug 1, 2008 at 12:17 PM, Osvaldo Alvarez Pozo wrote:
    > ---------- Forwarded message ----------
    > From: Osvaldo Alvarez Pozo
    > Date: Fri, Aug 1, 2008 at 12:09 PM
    > Subject: Re: running a command when there is a problem with proces
    > To: Dave Shield
    >
    >
    > I modified my snmpd.conf like this.
    > setEvent ProcessusError prErrFix = 1
    > monitor -r 10 -e ProcessusError -o prNames -o prErrMessage
    > "procTable" prErrorFlag != 0
    >
    >
    > And nothing happens, I do not get my trap either
    > are the "-o" and " -e" options exclusifs???
    >
    > Thanks
    >
    > On Fri, Aug 1, 2008 at 12:45 AM, Dave Shield wrote:
    >> 2008/7/31 Osvaldo Alvarez Pozo :
    >>> Im am checking the apache2 proces but my procfix does not get executed

    >>
    >> You need to action this yourself - either directly:
    >>
    >> $ snmpset .... prErrFix i 1
    >>
    >>
    >> or via a suitable monitor/setEvent combination:
    >>
    >> setEvent caniPressTheButtonAgain prErrFix = 1
    >> monitor -e caniPressTheButtonAgain "watch the prTable" prErrorFlag != 0
    >>
    >> (Note - not actually tested, but I think it should work)
    >>
    >> Dave
    >>

    >


    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-users mailing list
    Net-snmp-users@lists.sourceforge.net
    Please see the following page to unsubscribe or change other options:
    https://lists.sourceforge.net/lists/...net-snmp-users


+ Reply to Thread