1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
:

Several local modules in Linux for doing a general MySQL monitoring using the SQL/CLI tool. This could be done in any OS (adapting commands), just using the Pandora FMS agent.

Modules

Active threads 

module_begin 
module_name Mysql_Threads 
module_description Mysql Threads 
module_type generic_data 
module_exec mysqladmin status -u root -pxxxx | grep -o "Threads: [0-9]*" | awk '{ print $2 }' 
module_end 

SQL Queries 

module_begin 
module_name Mysql_Questions 
module_description Mysql Questions 
module_type generic_data_inc 
module_exec mysqladmin status -u root -pxxxx | grep -o "Questions: [0-9]*" | awk '{ print $2 }' 
module_end 

SQL Open (DB) 

module_begin 
module_name Mysql_Opens 
module_description Mysql Opens 
module_type generic_data_inc 
module_exec mysqladmin status -u root -pxxxx | grep -o "Opens: [0-9]*" | awk '{ print $2 }' 
module_end 

SQL Open (Table access) 

module_begin 
module_name Mysql_OpenTables 
module_description Mysql Opened tables 
module_type generic_data 
module_exec mysqladmin status -u root -pxxxx | grep -o "Open tables: [0-9]*" | awk '{ print $3 }' 
module_end 

SQL Queries per second 

module_begin 
module_name Mysql_QPS 
module_description Mysql Queries per second 
module_type generic_data 
module_exec mysqladmin status -u root -pxxxx | grep -o "Queries per second avg: [.0-9]*" | awk '{ print $5 }' 
module_end 

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 

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
(Visited 587 times, 1 visits today)

For correct visualization of the Pandora FMS library extension, you must have installed version NG 760 or superior

X