From a0d3f45aa53f65fd1b66e7d21a4718da14e90910 Mon Sep 17 00:00:00 2001 From: darode Date: Thu, 26 Apr 2012 12:01:40 +0000 Subject: [PATCH] 2012-04-25 Sergio Martin * unix/plugins/inventory: Fixed method of obtain runlevel to be valid on OpenSuse Merged from 4.0.x git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6188 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 6 ++ pandora_agents/unix/Linux/pandora_agent.conf | 69 ++++++++++++-------- 2 files changed, 46 insertions(+), 29 deletions(-) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index fd3ab9c44c..89bcf9ecc1 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -23,6 +23,12 @@ fill with empty string the empty columns, etc. for bug 3519796 Merged from 4.0.x +2012-04-25 Dario Rodriguez + + * unix/Linux/pandora_agent.conf: Improved linux configuration file. + + MERGED FROM 4.0.2 + 2012-04-25 Dario Rodriguez * win32/bin/pandora_agent.conf: Fixed a default module type. diff --git a/pandora_agents/unix/Linux/pandora_agent.conf b/pandora_agents/unix/Linux/pandora_agent.conf index 2dfa829dc3..1a65ddb7f9 100755 --- a/pandora_agents/unix/Linux/pandora_agent.conf +++ b/pandora_agents/unix/Linux/pandora_agent.conf @@ -178,51 +178,28 @@ module_exec cat /proc/loadavg | cut -d' ' -f1 module_description Average process in CPU (Last minute) module_end -# Get disk space free in MB -module_begin -module_name disk_root_free -module_type generic_data -module_exec df -kh / | tail -1 | awk '{ print 100-$5 }' -module_max 100 -module_min 0 -module_description Free disk Percentage of root partition -module_min_warning 70 -module_max_warning 90 -module_min_critical 91 -module_max_critical 100 -module_end - #Get free memory in MB module_begin -module_name memfree +module_name Chache mem free module_type generic_data module_exec free -m | grep buffers/cache | awk '{print $4}' -module_description Free memory in MB +module_description Free cache memory in MB module_min_warning 500 module_max_warning 600 module_min_critical 100 module_max_critical 499 module_end -# This module uses postprocess feature to unit conversion -module_begin -module_name memused -module_type generic_data -module_exec free -k | grep buffers/cache | awk '{print $3}' -module_postprocess 0,000976 -module_description Used memory in KB postprocessed to be in MB -module_end - #Count total number of processes module_begin module_name proctotal module_type generic_data module_exec ps -A | tail --lines=+5 | wc -l module_description Total processes -module_min_warning 600 -module_max_warning 799 -module_min_critical 800 -module_max_critical 1000 +module_min_warning 150 +module_max_warning 249 +module_min_critical 250 +module_max_critical 300 module_end # Process information @@ -243,6 +220,17 @@ module_exec last | head -1 module_description Monitor last user loggin module_end +# Module that get the number or cron file +# This module uses a precondition, if cron is running the +# module will check the folder /etc/cron.d to get the number of files +module_begin +module_name Cron task files +module_type async_string +module_precondition =~ .*cron.* ps aux | grep cron +module_exec ls -l /etc/cron.d | awk 'NR>1 {print $0}' | wc -l +module_description Number of cron task files +module_end + # Plugin example @@ -255,6 +243,29 @@ module_plugin pandora_df module_plugin grep_log /var/log/syslog Syslog ssh +# Get disk space free in MB +#module_begin +#module_name disk_root_free +#module_type generic_data +#module_exec df -kh / | tail -1 | awk '{ print 100-$5 }' +#module_max 100 +#module_min 0 +#module_description Free disk Percentage of root partition +#module_min_warning 70 +#module_max_warning 90 +#module_min_critical 91 +#module_max_critical 100 +#module_end + +# This module uses postprocess feature to unit conversion +#module_begin +#module_name memused +#module_type generic_data +#module_exec free -k | grep buffers/cache | awk '{print $3}' +#module_postprocess 0,000976 +#module_description Used memory in KB postprocessed to be in MB +#module_end + # Plugin for inventory on the agent (Only Enterprise) # module_plugin inventory 1 cpu ram video nic hd cdrom software