cancel
Showing results for 
Search instead for 
Did you mean: 

NAGIOS

SOLVED
Go to solution
Piotr Kirklewski
Super Advisor

NAGIOS

I was installing NAGIOS 3 on my linux box.
I'm not sure when it happened but as I'm running:

/usr/sbin/nagios -v /etc/nagios/nagios.cfg


I'm getting following error:

Warning: Duplicate definition found for command 'check_smtp' (config file '/etc/nagios/plugins.d/check_tcp.cfg', starting on line 33)
Error: Could not add object property in file '/etc/nagios/plugins.d/check_tcp.cfg' on line 34.


Can anyone help ?

Regards

Peter
Jesus is the King
5 REPLIES
Vitaly Karasik_1
Honored Contributor
Solution

Re: NAGIOS

I suggest just open check_tcp.cfg into text editor and comment out check_smtp command definition. I guess, this command is already defined in another configfile.
Piotr Kirklewski
Super Advisor

Re: NAGIOS

Hi I resolved this problem but I have another one:

Error: Service check command 'check_snmp' specified in service 'Port 1 Link Status' for host 'switch5' not defined anywhere!

It's sure defined in commands.cfg

# 'check_snmp' command definition
define command{
command_name check_snmp
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
}



vim switch.cfg looks like this:


define service{
use generic-service ; Inherit values from a template
host_name switch6
service_description Uptime
check_command check_snmp!-C public -o sysUpTime.0
}

Jesus is the King
Vitaly Karasik_1
Honored Contributor

Re: NAGIOS

>Error: Service check command 'check_snmp' >specified in service 'Port 1 Link Status' >for host 'switch5' not defined anywhere!

as far as I understand, mentioned service isn't the same service from switch.cfg
Piotr Kirklewski
Super Advisor

Re: NAGIOS

I've sorted the duplicated definition.
Now Nagios complains about check_snmp not being defined anywhere.
That's funny because Nagios 3.0.3 is comming with check_snmp defiend. More then that - in the documentation they said that they have already done it for you so you just sit and anjoy:

http://nagios.sourceforge.net/docs/nagios-3.pdf

Take a look at page 30 :
Whatâ s Already Done For You

I have a filing that the plan behind that is that if they will waist my time then I will buy their support.

But I'm thinking more about going to other solution instead.

Reagrds

PEter






Jesus is the King
Ralph Grothe
Honored Contributor

Re: NAGIOS

Hi Peter,

the pre-flight syntax check of nagios is pretty obvious (as almost every time one employs it, which one should do after every change to its configuration)

Error: Service check command 'check_snmp' specified in service 'Port 1 Link Status' for host 'switch5' not defined anywhere!

Nagios simply seems not to be able to find the command definition of "check_snmp" anywhere.

You seem to have put each Nagios object definition into a separate file which can become quite cluttered and unwieldy.
Please, check your main nagios.cfg how you defined where nagios should expect object definitions to find.

e.g. in my case I dedicated a whole directory to object definitions and grouped host, service, contact definitions etc into a scheme that somehow maps our environment in order not to get lost between all the files.

# grep -E '^[^#]*cfg_(file|dir)' /etc/nagios/nagios.cfg
cfg_dir=/etc/nagios/objects

And what you said about someone expecting you to buy their support couldn't be farther from the truth because none of the developers and contributors is doing so.
Quite to the contrary they are voluntarily very helpful.
Have you tried their mailing list yet?
Nagios is a wonderful toolset which leaves you utmost liberty in constructing the monitoring system that exactly suits your site's needs.
So I would like to encourage you to not give up prematurely (admittedly, the beginning can be a bit tedious, but it pays back soon manyfold).

Madness, thy name is system administration