This is a manual which helps you to monitor Linux/Unix based devices using Pandora FMS.
Module data
1. CPU Free
This module returns the free CPU percentage. The syntax for the module would be this:
module_begin module_name CPU Free module_type generic_data module_exec echo $(( 100 - `vmstat 1 2 | tail -1 | awk '{ print $15 }'`)) module_max 100 module_min 0 module_description Percentage CPU Free module_end
2. Last Login
Module that returns a text string with the last user connected. It is defined as a module of asyncrhonous type.
Its syntax is the following:
module_begin module_name Last Login module_type async_string module_exec last | head -1 module_description User last logged module_end
3. Load Average
It measures the CPU average load. The module definition would be like this:
module_begin module_name Load Average module_type generic_data module_exec uptime | awk -F "," '{print $3}' | awk '{print $3}' | tr -d “n” module_description Average load last minute module_end
For Suse 11.4 : (carriage return)
module_exec uptime | awk -F ":" '{print $4}' | awk -F " " '{print $1}' | sed "s/.$//" | tr -d “n”
4. Process Running
Checks if an specific process is being executed in the machine. For it, we should created one module in this way:
module_begin module_name Process xxx module_type generic_proc module_service xxx module_description Process XXX running module_end
Replacing xxx by the specific process that we want to monitor.
5. Physical mem. Free
This module returns the percentage of free space of the physical memory. The definition for this module would be this:
module_begin module_name Physical mem. free module_type generic_data module_freepercentmemory module_description Percentage Mem Free Phys module_end
6. Free swap
Returns in percentage the free space of swap memory. Its definition in the configuration file would be this:
module_begin module_name Free swap module_type generic_data module_exec free -m | grep Swap | awk '{print (($4 / $2)*100)}' module_description Percentage Mem Swap Free module_end
7. Pagination memory
Quantity of paginated memory:
module_begin module_name Pagination memory module_type generic_data module_exec vmstat 1 2 | tail -1 | awk '{ print $8 }' | tr -d “n” module_description Mem Paged module_end
8. Free Disk
It returns the number of processes that are running in the machine. The module syntax is this:
module_begin module_name Free Disk module_type generic_data module_freepercentdisk / module_description Percentage Free Disk module_end
9. Free inodes
It returns the percentage of free i-nodes of one partition:
module_begin module_name Free inodos / module_type generic_data module_exec df -i | grep -E "/$" | awk '{print 100-(($3/$2)*100)}' module_max 100 module_min 0 module_description Percentage Free i-nodos module_end
To see the partition /var for example, you should change the command grep of -E “/$” to
grep -E “/var$”. Besides changing the name of the module from inodo_/_free to inodo_/var_free.
For Ubuntu:
module_exec echo -n $(( 100 - `df -i | grep -E "/$" | awk '{print $5}' | tr -d “%”`))
For Suse:
module_exec echo -n $((100 - `df -i | grep -E “/$” | awk '{print $5}' | tr -d “n” | awk -F “%” '{print $1}' `))
10. Zombie processes
It counts the number of processes that are in the Zombie status. The structure of the module would be this:
module_begin module_name Zombie processes module_type generic_data module_exec ps -eos | grep Z | wc -l | tr -d “n” module_description Number of zombie processes module_end
11. Number processes
Counts the number of processes of the system:
module_begin module_name Number processes module_type generic_data module_exec ps -e | wc -l | tr -d “n” module_description Number of processes module_end
12. Processes high CPU
It returns the pid of the process that is consume more than the 90% of the CPU. Its syntax:
module_begin module_name Processes high CPU module_type generic_data_string module_exec ps -eo pcpu,pid | sort -n | grep -v CPU | tail -1 | awk '{if ($1>90) print $2; else print "NA"}' | tr -d "n" module_description PID Processes > 90% CPU module_end
13. Used inodes
Returns the percentage of free i-nodes of one partition
module_begin module_name Used inode / module_type generic_data module_exec df -i | grep -E "/$" | awk '{print $4}' | tr -d “%n” module_max 100 module_min 0 module_description Percentage use of i-nodes module_end
To look for the partition /var , for example, you should change the command grep from grep -E “/$” to grep -E “/var$”. Besides, you should also change the name of the module form inodo_/_free to inodo_/var_free.
For Ubuntu:
module_exec df -i | grep -E "/$" | awk '{print $5}' | tr -d “%n”
For Suse:
module_exec df -i | grep -E “/$” | awk '{print $5}' | tr -d “n” | awk -F “%” '{print $1}' | tr -d “n”
14. Time sync
Returns the schedule difference with the NTP server.
module_begin module_name Time sync module_type generic_data module_exec ntptrace 2>/dev/null | tr -d “n” | awk '{print $5}' | tr -d “,n” module_description Time difference with NTP module_endFiles:
pandora_linux_v1r1.zip