LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   ping similar command for checking server services (https://www.linuxquestions.org/questions/linux-general-1/ping-similar-command-for-checking-server-services-858525/)

golden_boy615 01-25-2011 07:42 AM

ping similar command for checking server services
 
hello
I am looking for a command line utility like ping that can use for checking appropriate services on a server . I do not want do any port scan . I just want to use it for checking apache , mail,ftp and other services on a server if they are running or down.

Thanks.

marozsas 01-25-2011 10:18 AM

You may be interested in nagios check_whatever plugins. They are command line utilities and return output on stdout. For instance, the check_http plugin returns:
Code:

# check_http -H intranet
HTTP OK HTTP/1.1 200 OK - 518 bytes in 0.003 seconds |time=0.002892s;;;0.000000 size=518B;;;0

check_http has cmd line options that can be used to test a specific page or returned value.

There are plugins for services like oracle, mail, ftp, ldap, postfix, smtp, etc....
There is also, check_nrpe, which allows you to check for a specific service on a server even this service is not networked-based. Basically you create a script or program in any language that check for the status of the service and return the status on stdout. Then you configure nrpe to call this program when check_nrpe is run from a remote host.

You don't need to install and setup the whole nagios if you are interested in having basic checking on a terminal.

golden_boy615 01-25-2011 12:05 PM

I didn't understand do I have to install nagios first?

marozsas 01-25-2011 01:52 PM

It depends.

If you are installing it (nagios plugins; nagios plugins extra and nagios nrpe) through a packet manager like rpm/yum/apt-get/whatever, them you may need to install nagios server to satisfy the dependencies. But you don't need to configure or start nagios server itself.

If you installing the plugins only using a tarball, then you don't need to install anything else.

On a CentOS 5.x (I guess it is similar in Fedora and RH), the packages are:
Code:

nagios-plugins-setuid-1.4.15-1.el5.rf
nagios-plugins-1.4.15-1.el5.rf
nagios-plugins-nrpe-2.12-1.el5.rf
nagios-nrpe-2.12-1.el5.rf

ANd the binaries will be at /usr/lib/nagios/plugins/ folder.

The nagios server itself (the one you don't need) is nagios.i386 0:3.2.3-3.el5.rf.

If you can, prefer the one that are installed by the package manager.


All times are GMT -5. The time now is 08:52 AM.