Service error, how does they work?


#1

Heya guys! This is my fist post here, so be gentle :wink:

Anyhow, ive recently installed a Nagios on my corporate network. Which actually is working fine.
However! I am abit unsure about certain things and I was hoping this forum could help me out with that.

Im confused about how services work.
Why? Because this errormsg in the eventlog on the webinterface :
**“Informational Message[10-14-2010 16:47:17] Warning: Duplicate definition found for service ‘F:\ Drive Space’ on host ‘PSW202’ (config file ‘/usr/local/nagios/etc/objects/kunder/IT-akuten/psw202.cfg’, starting on line 137)”
**
and if i go into that .cfg file the line is:

define service{
use generic-service
host_name PSW202
service_description F:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l f -w 80 -c 90
}

Ive set up my nagios system with each host containing services in each .cfg file. And for monitoring ALL the HDD’s on that specific host, ive only changed some letters in the default template of monitoring C: (Yes, sadly we’re talking about windows-machines).
So, is these errormsgs something to worry about and how do I fix it? And the more important question, how does the services work? Since it seems ive got shitloads of duplicates at this point.

I’ll gladly fill in more info if needed, im not a total tool :wink:

/Smashytech


#2

Not much to add… :slight_smile:

look for the duplicate definition.


#3

hehe yeah I kinda figured that was the issue :wink:

But hey, i’lll paint it down again: I got multiple hosts, and they way I’ve done this is for each host.cfg file I’ve included the services within that host.cfg file.
Meaning I got the same services in the other hosts like this:

"define service{
use generic-service
host_name PSW202
service_description C:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}

define service{
use generic-service
host_name PSW202
service_description E:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l e -w 80 -c 90
}

define service{
use generic-service
host_name PSW202
service_description F:\ Drive Space
check_command check_nt!USEDDISKSPACE!-l f -w 80 -c 90
}
"

So i dont get how they’re duplicates when ive modified the check_command on all of those 3 services? Or do i need to add a line to separate them?


#4

host_name and service_description have to be different to avoid duplicates. Are you sure you didn’t forgetr to update one while copying them over from one host to another?


#5

Okay, im a total tool.

Of course you’re right, i DID copy / paste it and on those lines i forgot to change the hostname… God I hate stupid misstakes… baah
Anyhow, thanks for pointing out my tardness :wink:

Works perfect now, cheers!


#6

happy it worked :smiley:


#7

Haha thanks dude :slight_smile:

Anyway, i have a followup-question, maybe a bit trickier.
I want to know who sends the information first, does the Nagios server poll all of its hosts, or does the clients send information to Nagios? Who does the initial query? :slight_smile:

Ive tried google it, but came up empty-handed.

/Smashy


#8

i think this is a RTFM question… :stuck_out_tongue:
nagios.sourceforge.net/docs/3_0/

look for the difference between active and passive checks (even if it isn’t the complete answer it’s a good starting point)


#9

Again, I agree, this was a case of RTFM… :smiley:

Anyhow, now to more reading, seems that passive checks will do what im looking for :slight_smile: