Page 1 of 1
Host Vs Service
Posted: Thu Apr 26, 2012 1:50 pm
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!

Re: Host Vs Service
Posted: Thu Apr 26, 2012 3:01 pm
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".
Re: Host Vs Service
Posted: Thu Apr 26, 2012 4:33 pm
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.
Re: Host Vs Service
Posted: Thu Apr 26, 2012 4:48 pm
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?

Re: Host Vs Service
Posted: Thu Apr 26, 2012 4:51 pm
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?

Re: Host Vs Service
Posted: Fri Apr 27, 2012 9:44 am
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.
Re: Host Vs Service
Posted: Fri Apr 27, 2012 10:19 am
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.