commands.cfg [nagios]
hello.
you know in commands.cfg, we would have to add in the commands to monitor a service (eg. http, ssh etc) I wonder if all the commands for the different services are the same? As in they have the same way of writing the command, except changing the service name: eg, for smtp: Code:
! # 'check_smtp' command definition Code:
! # 'check_telnet' command definition Code:
! # 'check_mysql' command definition And in the service.cfg.. i just write check_ssh and SSH respectively? Thanks |
Nagios comes with a set of pre-installed check commands. They are installed at /usr/libexec/nagios or /usr/local/nagios/libexec (anyway, the $USER1$ is expanded to the right place)
At that folder you can find several check_whatever commands, most of them are binary files, some are shell or perl scripts. If there is not a suitable check program to a special service in your site you can write one and drop it at that folder. After that just add a definition to it, just like above. And yes, nagios already comes with a check_ssh program: Code:
[root@spy objects]# ../../libexec/check_ssh Code:
# 'check_ssh' command definition Code:
|
hello.
sorry, i made a typo for the last question, regarding check_ssh. i want to ask for check_sql for sql service instead of check_ssh. thanks |
Quote:
|
So, in services.cfg i write this:
Code:
define service{ |
Quote:
for command option you can use --help option. /usr/local/nagios/libexec/check_mysql --help |
Hmm okay.
I tried that command: "/usr/local/nagios/libexec/check_mysql --help" but it gave me: Code:
xanios@ubuntu:~$ /usr/local/nagios/libexec/check_mysql --help i thought by default when i installed the plugins, it is already installed? |
Code:
is it because i didn't have mysql plugins installed? HTH |
Oh okay :)
Hmm, one last question: there are a lot of ports out there, so if i want to monitor other services besides the above mentioned my_sql, i just change the service description and check_command for services.cfg and command_name and command_line in commands.cfg? something like: Code:
define command{ Code:
define service{ |
How do you had installed nagios plugins ? By compiling the source and installing it in /usr/local or by installed a deb package by apt-get ?
In the first case, search for check_mysql using "find /usr/local -iname "check_mysql". In the last case, use "dpkg -S package_name"; in ubuntu Lucid, there are 4 packages with plugins, you have to test all you have installed: nagios-plugins, nagios-plugins-basic, nagios-plugins-standard and nagios-plugins-extra. |
Quote:
I am also looking same kind of solution. I have one question. if check_mysql doesn't exists and i want to install it. how can i do this? want i compile nagios-plugin again and install it? i just want one plugin. Thanks in advance. |
I used apt-get.
for "find /usr/local -iname "check_mysql", there is no output after i typed the command. what does it mean? for "dpkg -S package_name", you asked me to check for the 4 packages, is it like this: dpkg -S nagios-plugins and so on. |
Quote:
sudo apt-get install mysql-server mysql-client i think you can refer to this : http://ariejan.net/2007/12/12/how-to...-ubuntudebian/ |
Hi Xanios,
Quote:
|
Hi babunix,
Quote:
Install mysql-client and musql devel package compile nagios plugin (run ./configure with option, run make, make install doesn't require) copy check_mysql from <nagios-plugin-source>/plugins directory to your libexec dir. HTH |
Quote:
check_mysql now in my libexec dir. and it works |
Hi sem007,
i installed my_sql into my ubuntu platform from here: http://ariejan.net/2007/12/12/how-to...-ubuntudebian/, i followed all the steps in given in the web page so by right mysql should be up in ubuntu? But instead when i view the status of mysql in nagios browser, i got this: Code:
(Return code of 126 is out of bounds - plugin may be missing) what might be wrong? |
How you monitor your mysql server?
error says plugin missing. check check_mysql plugin is there(/usr/local/nagios/libexec)? if no then read post #11 in this post one member post question how to install check_mysql and in next post i write how solution. |
is it something like:
Code:
xanios@ubuntu:~$ sudo vi /usr/local/nagios/libexec/check_mysql Code:
xanios@ubuntu:~$ sudo /usr/local/nagios/libexec/check_mysql i saw that post, i tried to install mysql devel package but they gave me: Code:
xanios@ubuntu:~$ sudo apt-get install mysql-devel |
All times are GMT -5. The time now is 09:16 PM. |