Host Vs Service

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
dupdupdup
Posts: 3
Joined: Thu Apr 26, 2012 1:47 pm

Host Vs Service

Post by dupdupdup »

Hello everyone i need some help understanding host and service notifications.

What is the difference between host and service?

When i define a host and dont define a service for that i get a warning. Is it okay?

You basically can define the same thing for host as for service. So when should i define a host and when should i define a servie?

Thanks in advance! :)
wormfishin
Posts: 31
Joined: Tue Apr 10, 2012 8:11 am

Re: Host Vs Service

Post by wormfishin »

I find it easiest to think in terms of physical servers.

The "Host" is the physical box, the "Services" are applications running on that box.

Typically you will have multiple "services" configured on a single "host".
GaWd
Posts: 51
Joined: Wed Dec 15, 2010 1:45 pm

Re: Host Vs Service

Post by GaWd »

The only thing to remember is that normally if you create a host without 1 or more services, you will get a warning regarding that. Normally, if I'm just monitoring a host's up-status, I toss a pingcheck in for the same host.

So, hosts are virtual or physical devices, services are just that...hardware, software, services, and other types of checks.
dupdupdup
Posts: 3
Joined: Thu Apr 26, 2012 1:47 pm

Re: Host Vs Service

Post by dupdupdup »

Sorry cause im doing nagios for a school assignment. So is it okay to ignore the warning and just monitor a host using ping without declaring a service for it? :D
dupdupdup
Posts: 3
Joined: Thu Apr 26, 2012 1:47 pm

Re: Host Vs Service

Post by dupdupdup »

another question is.. if i have to monitor a service, lets say smtp.google.com, i have to definitely define a host for it? :D
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: Host Vs Service

Post by agriffin »

You should have at least one service for each host, even if it's just a ping check. You could change the host check to something else if you don't want two checks pinging the host. You also could actually put all your services under a single host if you wanted to, regardless of whether or not they're located on the same box/address. It would make things pretty unmanageable in a production environment though.
GaWd
Posts: 51
Joined: Wed Dec 15, 2010 1:45 pm

Re: Host Vs Service

Post by GaWd »

agriffin's advice is spot-on.

Normally I use simple check_host_alive for hosts, and then use more complicated or targeted checks for services. Unless, of course, upstatus is all you care about. In my production environment, I normally make sure to have as few warnings as possible, but I still occasionally use a serviceless host. 2 pings is too much for a low-cost host when you're monitoring hundreds of hosts and hundreds upon hundreds of services in a high-availability environment.
Locked