Toon posts:

Linux met snmp process monitoren

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik ben bezig met het inrichten van een snmp applicatie.

Nu wil ik met dit programma (SNMPc) onze linux server in de gaten houden.

Voor onze cisco apparatuur kan ik b.v. RFC1213-MIB|ifOperStatus.31 gebruiken om een interface in de gaten te houden :) .


Ik ben op zoek geweest naar een mib om een process te kunnen monitoren (up/down)
Echter ik kan geen geschikte mib vinden, en ik weet niet goed hoe ik deze moet vinden.
Ik kan wel de mib database bekijken, maar deze is erg groot en dit is lastig zoeken.

Hoe kan ik deze het besten vinden?
Is het mogelijk om een process naam te gebruiken? Een process ID lijkt me niet handig omdat deze na een re-boot veranderd. :(

  • Seth4Chaos
  • Registratie: Maart 2001
  • Niet online

Seth4Chaos

that's me...

met een grep had je al een eind kunnen komen:
code:
1
2
3
4
5
6
7
8
9
10
seth@titan ~ $ snmpwalk -v 1 -c public localhost | grep init
SNMPv2-MIB::sysORDescr.9 = STRING: The management information definitions for the SNMP User-based Security Model.
HOST-RESOURCES-MIB::hrSWRunName.1 = STRING: "init"
HOST-RESOURCES-MIB::hrSWRunPath.1 = STRING: "init [3]"
HOST-RESOURCES-MIB::hrSWRunParameters.29561 = STRING: "init"
seth@titan ~ $ snmpwalk -v 1 -c public -On localhost | grep init
.1.3.6.1.2.1.1.9.1.3.9 = STRING: The management information definitions for the SNMP User-based Security Model.
.1.3.6.1.2.1.25.4.2.1.2.1 = STRING: "init"
.1.3.6.1.2.1.25.4.2.1.4.1 = STRING: "init [3]"
.1.3.6.1.2.1.25.4.2.1.5.29563 = STRING: "init"
dit is dan een grep op init maar je moet even een grep doen op het proces wat jij wilt.

Wat ook een optie is is in /etc/snmp/snmpd.conf de volgende regels aanpassen/aanzetten:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
###############################################################################
# Process checks.
#
#  The following are examples of how to use the agent to check for
#  processes running on the host.  The syntax looks something like:
#
#  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.

#
#  Examples:
#

#  Make sure mountd is running
#proc mountd

Mistakes are proof that you are trying...