用Nagios监控OSSIM中MySQL数据库

OSSIM下监控Mysql的方式有很多,今天介绍在命令行下进行监控。通常你在OSSIM5下进行监控会遇到缺少libmysqlclient.so.15这个问题文件,但你在ossim 2.3 和ossim 3.0系统中则没有此类问题。

VirtualUSMAllInOne:~# /usr/lib/nagios/plugins/check_mysql -s /var/run/mysqld/mysqld.sock -p PZyAHooqzy

/usr/lib/nagios/plugins/check_mysql: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory

将这个文件拷贝过来就可以直接使用,下面告诉你到什么地方下载。

VirtualUSMAllInOne:~# wget -O /usr/lib/libmysqlclient.so.15 http://files.directadmin.com/services/es_5.0_64/libmysqlclient.so.15

--2015-09-08 10:14:00--  http://files.directadmin.com/services/es_5.0_64/libmysqlclient.so.15

Resolving files.directadmin.com... 216.144.254.90, 208.167.226.3, 69.162.69.58

Connecting to files.directadmin.com|216.144.254.90|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 1474856 (1.4M) [application/octet-stream]

Saving to: `/usr/lib/libmysqlclient.so.15'


100%[===============================================================>] 1,474,856    195K/s   in 9.2s    


2015-09-08 10:14:10 (157 KB/s) - `/usr/lib/libmysqlclient.so.15' saved [1474856/1474856]

下载完毕,再次执行这行命令看看效果吧。

VirtualUSMAllInOne:~# /usr/lib/nagios/plugins/check_mysql -s /var/run/mysqld/mysqld.sock -p PZyAHooqzy

Uptime: 253321  Threads: 16  Questions: 2688108  Slow queries: 6  Opens: 2551  Flush tables: 1  Open tables: 549  Queries per second avg: 10.611

VirtualUSMAllInOne:~# 

好啦现在你可以写到CFG配置文件中,更多案例参见即将上市的新书。

你可能感兴趣的:(ossim)