Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(SOLVED)monitoring services through snmp
#1
Hello,

I am trying to monitor services through snmp on ubuntu. However since the PID of a service changes when it restarts giving it a different OID i tend to lose track of the service when it restarts. Is there a way around this or am i going about this monitoring wrongly.
 Reply
#2
hi dan

try to use the ps command, is more usefull than snmp to monitor process of a linux computer

Code:
# Process information
module_begin
module_name smsDaemon
module_type generic_proc
module_exec ps -Af | grep smsd | grep -v "grep" | wc -l
module_description check the sms process
module_end
 Reply
#3
hello alumbreras...thanks for the help.

After defining a module like you mentioned in the pandora_agent.conf, will it show in the pandora_console automatically or will i have to define a data module through the console. 

I tried testing a module i found at http://pandorafms.com/index.php?sec=pand...&id_PUI=43

#MySQL process (mysqld) CPU usage (%)
module_begin
module_name Mysql_CPU
module_description Mysql CPU usage (%)
module_type generic_data
module_exec ps aux | grep "mysqld --basedir" | grep -v "grep" | awk '{ print $3 }'
module_end

however the data doesn't show on the console.

Thanks again for the help.
 Reply
#4
Hi .

You don´t have to create a new module in the console, you just have to put your agent in learning mode (by default) and then restart the agent, after that it should be the new module you created with all the other modules of that agent.

If not you should check the logs a see if you receive an error.

Regards.
 Reply
#5
hello Jartel...thanks for your response. 

I tried it and it worked.  Initially it wasn't showing but i tried the module exec command from this module in terminal and realized that it wasn't displaying any value.

Code:
MySQL Process (mysqld) RAM usage (%)

module_begin
module_name Mysql_RAM
module_description Mysql RAM usage (%)
module_type generic_data
module_exec ps aux | grep "mysqld --basedir" | grep -v "grep" | awk '{ print $4 }'
module_end

hence i figured something was wrong with the module on the pandora module library because the other ones i tried like the active threads and querries works just fine.
 Reply
#6
(06-29-2012, 08:49 AM)dan2kg link Wrote: hello Jartel...thanks for your response. 

I tried it and it worked.  Initially it wasn't showing but i tried the module exec command from this module in terminal and realized that it wasn't displaying any value.

Code:
MySQL Process (mysqld) RAM usage (%)

module_begin
module_name Mysql_RAM
module_description Mysql RAM usage (%)
module_type generic_data
module_exec ps aux | grep "mysqld --basedir" | grep -v "grep" | awk '{ print $4 }'
module_end

hence i figured something was wrong with the module on the pandora module library because the other ones i tried like the active threads and querries works just fine.

Go to console (under the same user is executing the agent, most cases is root) and try to play with the command until find what is the problem.

First:

ps aux | gerp "mysqld --basedir" | grep -v grep

And see if report something

If not:

ps aux | gerp "mysqld" | grep -v grep

And go on to find the exact command match.

Good luck !
 Reply
#7
Wow thanks for the quick response. when i tried the response you gave it worked.
The module with the 
Code:
module_exec ps aux | grep "mysqld --basedir" | grep -v "grep" | awk '{ print $4 }'
does not work.

However with
Code:
ps aux | grep "mysqld" | grep -v grep | awk '{ print $4 }'
it works perfectly.

Thanks for the help
 Reply
#8
I change the post as solved.
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes