Monitoring processes on Linux
Moderators: Developers, Moderators
Monitoring processes on Linux
Hello, I've just managed to get Cacti 0.8.6f with thold and monitor working on Linux! I love it. I have one question though, can I monitor processes? I've seen the example for monitoring processes on win32 (http://forums.cacti.net/about6661-0-asc-0.html) and I plan to use that but does anyone have any example for doing the same on linux?
Thanks,
Sapan
Thanks,
Sapan
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
With UCD/Net-SNMP, you can add this to snmpd.conf :
Try running this command without a 'top' process running :
And then with one 'top' process running :
You could then use the prErrorFlag.1 to know if your processes are up/down[/b]
Code: Select all
# Make sure at least one top, but less than or equal to 3 are running.
proc top 3 1
Code: Select all
$ snmpwalk -v 1 -c public localhost ucdavis.prTable
UCD-SNMP-MIB::prIndex.1 = INTEGER: 1
UCD-SNMP-MIB::prNames.1 = STRING: top
UCD-SNMP-MIB::prMin.1 = INTEGER: 1
UCD-SNMP-MIB::prMax.1 = INTEGER: 3
UCD-SNMP-MIB::prCount.1 = INTEGER: 0
UCD-SNMP-MIB::prErrorFlag.1 = INTEGER: 1
UCD-SNMP-MIB::prErrMessage.1 = STRING: Too few top running (# = 0)
UCD-SNMP-MIB::prErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::prErrFixCmd.1 = STRING:
Code: Select all
$ snmpwalk -v 1 -c public localhost ucdavis.prTable
UCD-SNMP-MIB::prIndex.1 = INTEGER: 1
UCD-SNMP-MIB::prNames.1 = STRING: top
UCD-SNMP-MIB::prMin.1 = INTEGER: 1
UCD-SNMP-MIB::prMax.1 = INTEGER: 3
UCD-SNMP-MIB::prCount.1 = INTEGER: 1
UCD-SNMP-MIB::prErrorFlag.1 = INTEGER: 0
UCD-SNMP-MIB::prErrMessage.1 = STRING:
UCD-SNMP-MIB::prErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::prErrFixCmd.1 = STRING:
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
Here's an example :
in /etc/snmp/snmpd.conf
Here are the apache processes :
You can then query them with snmp :
If you want to graph the number of apache processes, use the OID prCount.1
You can also take a look at this extension "ApacheStats version 0.4": http://forums.cacti.net/viewtopic.php?t=4028
It allows you to graph the apache threads :
Code: Select all
proc apache2
Here are the apache processes :
Code: Select all
$ ps -fu apache
UID PID PPID C STIME TTY TIME CMD
apache 6364 6292 0 Aug17 ? 00:00:00 /usr/sbin/apache2 -k start -D SS
apache 20646 6292 0 Aug17 ? 00:00:02 /usr/sbin/apache2 -k start -D SS
apache 22859 6292 0 Aug17 ? 00:00:04 /usr/sbin/apache2 -k start -D SS
apache 23684 6292 0 Aug17 ? 00:00:02 /usr/sbin/apache2 -k start -D SS
apache 26929 6292 0 Aug17 ? 00:00:02 /usr/sbin/apache2 -k start -D SS
apache 28791 6292 0 Aug17 ? 00:00:04 /usr/sbin/apache2 -k start -D SS
apache 609 6292 0 Aug17 ? 00:00:03 /usr/sbin/apache2 -k start -D SS
apache 9756 6292 0 Aug17 ? 00:00:02 /usr/sbin/apache2 -k start -D SS
apache 13977 6292 0 Aug17 ? 00:00:00 /usr/sbin/apache2 -k start -D SS
apache 30285 6292 0 Aug17 ? 00:00:01 /usr/sbin/apache2 -k start -D SS
apache 5537 6292 0 Aug17 ? 00:00:02 /usr/sbin/apache2 -k start -D SS
Code: Select all
$ snmpwalk -v 1 -c public localhost ucdavis.prTable
UCD-SNMP-MIB::prIndex.1 = INTEGER: 1
UCD-SNMP-MIB::prNames.1 = STRING: apache2
UCD-SNMP-MIB::prMin.1 = INTEGER: 0
UCD-SNMP-MIB::prMax.1 = INTEGER: 0
UCD-SNMP-MIB::prCount.1 = INTEGER: 12
UCD-SNMP-MIB::prErrorFlag.1 = INTEGER: 0
UCD-SNMP-MIB::prErrMessage.1 = STRING:
UCD-SNMP-MIB::prErrFix.1 = INTEGER: 0
UCD-SNMP-MIB::prErrFixCmd.1 = STRING:
You can also take a look at this extension "ApacheStats version 0.4": http://forums.cacti.net/viewtopic.php?t=4028
It allows you to graph the apache threads :
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
Excellent! Thanks very much, I'm going to give that a try for the web servers.
Have you ever used Nino? I tried it a while ago, it seemed to be able to get information about running processes without adding anything to snmpd.conf. Do you know how to do that?
It would be great if I could build some kind of wizard that would get a list of running processes and then I could just select the ones I want to graph and monitor.
Have you ever used Nino? I tried it a while ago, it seemed to be able to get information about running processes without adding anything to snmpd.conf. Do you know how to do that?
It would be great if I could build some kind of wizard that would get a list of running processes and then I could just select the ones I want to graph and monitor.
- fmangeant
- Cacti Guru User
- Posts: 2345
- Joined: Fri Sep 19, 2003 8:36 am
- Location: Sophia-Antipolis, France
- Contact:
I didn't konw Nino, looks interesting.
[size=84]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
[color=green]HOWTOs[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15353]Install and configure the Net-SNMP agent for Unix[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=26151]Install and configure the Net-SNMP agent for Windows[/url]
[*][url=http://forums.cacti.net/viewtopic.php?t=28175]Graph multiple servers using an SNMP proxy[/url][/list]
[color=green]Templates[/color] :
[list][*][url=http://forums.cacti.net/viewtopic.php?t=15412]Multiple CPU usage for Linux[/url]
[*][url=http://forums.cacti.net/viewtopic.php?p=125152]Memory & swap usage for Unix[/url][/list][/size]
I've found that this will give me a list of all running processes in a simple format, now all I need to do it write a script -
snmpwalk -OQ -Ov -v1 -c public localhost .1.3.6.1.2.1.25.4.2.1.2
snmpwalk -OQ -Ov -v1 -c public localhost .1.3.6.1.2.1.25.4.2.1.2
Last edited by sapg on Tue Oct 21, 2008 10:35 pm, edited 1 time in total.
Re: Monitoring processes on Linux
Anyone able to get linux process or TOp into cacti graph
- camerabob
- Cacti User
- Posts: 386
- Joined: Fri Feb 10, 2017 2:45 pm
- Location: Long Island, New York, USA
- Contact:
Re: Monitoring processes on Linux
This is probably the biggest stretch between posts. 14 years???
Prod: Cacti 1.2.15 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4
Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Maint @ 1.2
Monitor @ 2.3.6
Thold @ 1.2.4
Temp: Cacti 1.2.3 @ CentOS Linux release 7.9.2009 (Core) & PHP 5.4.16-48.el7
Flowview @ 2.1
Mactrack @ 4.2
Maint @ 1.2
Monitor @ 2.3.6
Router Configs @ 1.3.4
Syslog Monitoring @ 2.1
Thold @ 1.2.4
Who is online
Users browsing this forum: No registered users and 4 guests