Unix/linux - Monitor running processes - snmp

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: snmpwalk output explained.

Post by gandalf »

sebbs wrote:UCD-SNMP-MIB::prCount.1 = INTEGER: 9 <- 9 running httpd processes
UCD-SNMP-MIB::prCount.2 = INTEGER: 1 <- 1 running mysqld process
That's the interesting stuff. You will need to write down the OID. Run snmpwalk using the option -On to find OIDs. Then see first link of my signature. Scroll down to SNMP stuff and use the example by simply replacing the OID with the one you've found above.
This will work if sequence of proc statements in snmpd.conf is left unchanged
Reinhard
User avatar
sebbs
Cacti User
Posts: 97
Joined: Mon Jan 22, 2007 9:41 am
Location: Ottawa,Canada

awesome!

Post by sebbs »

thanks, I will try that, and let you know how it turns out.
If all else fails, rm -rf /
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

Well
he works :
[root@localhost scripts]# snmpwalk -v1 -c public localhost prTable
UCD-SNMP-MIB::prIndex.1 = INTEGER: 1
UCD-SNMP-MIB::prIndex.2 = INTEGER: 2
UCD-SNMP-MIB::prNames.1 = STRING: firefox
UCD-SNMP-MIB::prNames.2 = STRING: gthumb
UCD-SNMP-MIB::prMin.1 = INTEGER: 0
UCD-SNMP-MIB::prMin.2 = INTEGER: 0
UCD-SNMP-MIB::prMax.1 = INTEGER: 0
UCD-SNMP-MIB::prMax.2 = INTEGER: 0
UCD-SNMP-MIB::prCount.1 = INTEGER: 0
UCD-SNMP-MIB::prCount.2 = INTEGER: 0
UCD-SNMP-MIB::prErrorFlag.1 = INTEGER: 1
UCD-SNMP-MIB::prErrorFlag.2 = INTEGER: 1
UCD-SNMP-MIB::prErrMessage.1 = STRING: No firefox process running.
UCD-SNMP-MIB::prErrMessage.2 = STRING: No gthumb process running.
UCD-SNMP-MIB::prErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::prErrFix.2 = INTEGER: 0
UCD-SNMP-MIB::prErrFixCmd.1 = STRING:
UCD-SNMP-MIB::prErrFixCmd.2 = STRING:
[root@localhost scripts]# snmpwalk -v1 -c public localhost prTable -On
.1.3.6.1.4.1.2021.2.1.1.1 = INTEGER: 1
.1.3.6.1.4.1.2021.2.1.1.2 = INTEGER: 2
.1.3.6.1.4.1.2021.2.1.2.1 = STRING: firefox
.1.3.6.1.4.1.2021.2.1.2.2 = STRING: gthumb
.1.3.6.1.4.1.2021.2.1.3.1 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.3.2 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.4.1 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.4.2 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.5.1 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.5.2 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.100.1 = INTEGER: 1
.1.3.6.1.4.1.2021.2.1.100.2 = INTEGER: 1
.1.3.6.1.4.1.2021.2.1.101.1 = STRING: No firefox process running.
.1.3.6.1.4.1.2021.2.1.101.2 = STRING: No gthumb process running.
.1.3.6.1.4.1.2021.2.1.102.1 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.102.2 = INTEGER: 0
.1.3.6.1.4.1.2021.2.1.103.1 = STRING:
.1.3.6.1.4.1.2021.2.1.103.2 = STRING:
so my oid to count number process gthum is :.1.3.6.1.4.1.2021.2.1.5.2

Look screen ettachment

and know i stay for graph and after i hope it's works
do you know another technique to add oid on graph beacause with this technique i have only one oid graph i don't add another generic oid snmp?
Attachments
The final graph
The final graph
06.jpg (29.48 KiB) Viewed 13531 times
well i create a Graph like this :
well i create a Graph like this :
04.jpg (104.19 KiB) Viewed 13534 times
Well i write this my oid!
Well i write this my oid!
05.jpg (68.7 KiB) Viewed 13534 times
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

but now the question is
how i make this with snmp windows
and how i make other generique snmp onmy device?
because cacti want only one generic snmp ?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

up
well i know how i use some many same template but now
i can found how active prTable on WIndows some one can help please?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

how to make this with windows please?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

i up this post because i release a template to make it
i hope some one can help me to fix some thing?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
Mika2006
Cacti User
Posts: 178
Joined: Thu May 03, 2007 2:25 am

Post by Mika2006 »

anyone can try it and help me to gettit better please?
|Cacti Version - 0.8.6j||Plugin Architecture - 1.1||Poller Type - CMD.php|
|os - Red hat 4es | |Web Server - Apache/2.0.52 (Red Hat)|
|PHP - 4.3.9| |MySQL - 4.1.20| |RRDTool - 1.2.13||SNMP - 5.1.2|
|Plugins| Host Info (hostinfo - v0.1)
sebish
Posts: 7
Joined: Wed May 23, 2012 7:22 am

Re: Unix/linux - Monitor running processes - snmp

Post by sebish »

I still do not get how you can monitor one process @ unix by name.

My thoughts:

Need to get the hrSWRunName table and filter for (example) "apache2".
Get the hrSWRunStatus table and compare the OIDs (pids) to get (only) the status of all apache2 processes.
Get all the apache2 process status as multiple Integers 1 to 4.
Last step would be that cacti should graph those with "1", "2" as running and "3", "4" as Problem/Down.

I really really dont know how to get this into a script for cacti :(
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests