Page 1 of 2

how to add a service to nagios

Posted: Tue Nov 06, 2012 3:39 am
by Ladi
Hi everyone,

Please i will like you to help me on how am going to install nagios client to my new server that i want to monitor. we have a five servers that we are monitoring through nagios, so we just have a new server also that we want this nagios to be monitoring for us, on this server, we have four application that are running on it, so we want this nagios to be monitioring all these four application for us individually. please i want you guy help on how am going to install it and add this service to the existing on.. Below are the type of application that we have on the new server.

https://180.54.345.4:8090/iweb
https://180.54.345.4:8090/imobile
https://180.54.345.4:8090/mweb
https://180.54.345.4:8090/mmobile

Please i will be glad if u guys can help me on this.

Thanks so much
Ladi

Re: how to add a service to nagios

Posted: Tue Nov 06, 2012 11:10 am
by agriffin
Certain metrics about these applications will probably need to be shared among them, like system load, since they're all on the same server. So what kind of things are you looking to monitor about these applications individually?

Also, if you could provide the following info in your next post that would help a lot: Nagios version, Operating System version, and whether Nagios was compiled from source or installed from a package.

Re: how to add a service to nagios

Posted: Wed Dec 12, 2012 9:52 am
by Ladi
Hi,
Thanks so much for your response. What we actually want to do is to monitor their performance separately.that is,we want to know when any of them is down. For example if iweb is down,we need notification about it and also when all the application are down.

We are currently running in Nagios core version 3.4.1 and running on operating system Solaris 10 by SunOS.

I will be glad if you can assist me in achieving this , so that i can be free from my boss.

Thanks and regards,

Re: how to add a service to nagios

Posted: Wed Dec 12, 2012 3:30 pm
by slansing
If they are all separate processes running on that system, and you would like to know if they are still up or if they are down, you could run a check somewhat like this one with modifications for processes:

http://assets.nagios.com/downloads/nagi ... h_NRPE.pdf

There may also be some plugins located at the exchange regarding process checks:

http://exchange.nagios.org/

One such as this perhapse?

http://exchange.nagios.org/directory/Pl ... 10/details

Re: how to add a service to nagios

Posted: Tue Dec 18, 2012 7:34 am
by Ladi
Thanks so much for the swift response. I don't know how to define the service definition for the four application services. The application was deployed inside web application on Glassfish. Have added the host name. i will be happen if you can tell me what to write on this.
Below is my script

###############################################################################
###############################################################################
#
# HOST DEFINITION
#
###############################################################################
###############################################################################

# Define a host for the local machine






define host { 180.54.345.4:8090
use linux-server
host_name PROD_USSD
alias PROD ussd
address 180.54.345.4
_USERNAME matin
_PASSWORD captain
_PORT 8090
}

###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################


# Define a service to "ping" the local machine

define service{
use local-service ; Name of service template to use
host_name localhost
hostgroup_name solaris servers
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}


# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.

define service{
use local-service ; Name of service template to use
hostgroup_name solaris servers
service_description SSH
check_command check_ssh
notifications_enabled 0
}



# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.

define service{
use local-service ; Name of service template to use
host_name localhost
service_description HTTP
check_command check_http
notifications_enabled 0
}

define service{
use local-service
hostgroup_name solaris-servers
service_description CPU load
check_command check_remote_load!75%!90%
}

define service{
use local-service
hostgroup_name solaris-servers
service_description DISK root partition
check_command check_remote_disk!20%!10%!/
}

define service{
use local-service
hostgroup_name solaris-servers
service_description DISK opt partition
check_command check_remote_disk!20%!10%!/opt
}

Re: how to add a service to nagios

Posted: Tue Dec 18, 2012 2:08 pm
by slansing
I'm not sure what you are asking here, what else are you looking to add?

Re: how to add a service to nagios

Posted: Wed Dec 19, 2012 3:09 am
by Ladi
HI Slansing,

Have not define the service name, don't forget i told you that the service name are iweb,imobile,mweb,mmobile which have not define. The only thing i could see that nagios is monitoring on the server is PING, SSH, HTTP ,CPU LOAD AND DISK PARTITION. I still don't know to configure this.

Hope u understand what i want now.

Thanks for your assistance.

Re: how to add a service to nagios

Posted: Wed Dec 19, 2012 12:07 pm
by slansing
Okay I see, I thought you had already defined those, simply look at the definitions and reference them like so:

Code: Select all

define service{
use iweb
hostgroup_name solaris-servers
service_description CPU load
check_command check_remote_load!75%!90%
}
The above will monitor the Host named iweb, and return cpu load information.. if the load reaches 75% it will trigger a warning state change and alert, if it reaches 90% it will trigger a critical state change and alert.

Code: Select all

use = Host Name

hostgroup_name = The name of the Hostgroup which the host is a part of.

service_description = How the service will be shown on the web UI

check_command = The alias for the command being ran, separated by "!" for each argument.

Re: how to add a service to nagios

Posted: Thu Dec 20, 2012 8:25 am
by Ladi
Hi Slansing,

Thanks for your response. That means i have to replicate the configuration you gave me four time. i.e iweb,imobile,mweb,mmobile.

Please would this send me a notification if the services are up and send notification if the services are down too, because that is the major thing or do i need to change the service description and check_command.

I will appreciate if you can send me the type of service_ description and check_command that will be fit in for this service.


Thank for your assistance, i do appreciate it.

Re: how to add a service to nagios

Posted: Thu Dec 20, 2012 11:37 am
by slansing
I can really only send you what I already have, the command itself, and notification settings would be specific to you. As far as notifications, Nagios will notify whoever you have set up to receive notifications if this service goes down for whatever reason.

If you need any guidelines you can always visit the documentation:

http://nagios.sourceforge.net/docs/nagi ... n/toc.html