Page 2 of 2

Re: Add more services to Nagios Core vers. 4.3.2

Posted: Fri Sep 29, 2017 4:47 am
by michaelpn
Hi dwasswa,

thanks a lot:) but if take your example I get this answer from Nagios:

# nagios shell

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not find any host matching 'DOCPOINT_HandleMails:3289' (config file '/usr/local/nagios/etc/objects/hostgroups.cfg', starting on line 339)
Error: Failed to expand host list 'DOCPOINT_HandleMails:3289' for service 'Lasernet 7 HandleMails:3289' (/usr/local/nagios/etc/objects/hostgroups.cfg:339)
Error processing object config files!

I do not think that is a good idea changing the host_name because then Nagios do not know server name. In the "hostgroup.cfg" config file I give the servers their ordinary names. If I change the host_name as you suggest I also have to change it for:


1: HOST GROUP DEFINITIONS

2: SERVICE DEFINITIONS

Try to look at then hostgroup.cfg file I have attached for you:) and also a frame from Nagios services site where you can see the services from DOCPOINT:

I myself have tried to solve the above issue but I did not succeed.

The two services are authenticated by the Docpoint Server because they are connected to a Lasernet Developer. The Lasernet Print Capture 7 has no authentication. But I'm not sure it har anything to do with that ?

Re: Add more services to Nagios Core vers. 4.3.2

Posted: Fri Sep 29, 2017 9:22 am
by scottwilkerson
You need to edit the hostgroups.cfg

You added a service_description to a hostgroup which isn't possible
michaelpn wrote:I do not think that is a good idea changing the host_name because then Nagios do not know server name. In the "hostgroup.cfg" config file I give the servers their ordinary names. If I change the host_name as you suggest I also have to change it for:
Actually it does, in your previous examples you set the host_name to DOCPOINT THAT is what you would add to a host group not the service_description

Re: Add more services to Nagios Core vers. 4.3.2

Posted: Fri Sep 29, 2017 9:49 am
by michaelpn
Hi scottwilkerson,

not understood ?

Re: Add more services to Nagios Core vers. 4.3.2

Posted: Fri Sep 29, 2017 9:58 am
by scottwilkerson
you need to edit this file
/usr/local/nagios/etc/objects/hostgroups.cfg

Just after line 339 you have hostgroup with members section that has DOCPOINT_HandleMails:3289 this needs to be removed

The hostgroups (kopi).cfg file you posted does not match the error you described.

Re: Add more services to Nagios Core vers. 4.3.2

Posted: Fri Sep 29, 2017 10:04 am
by scottwilkerson
michaelpn wrote: But for the two others:

# my exeample:
define service {
use generic-service
host_name DOCPOINT
service_description Lasernet 7 NetsShare 3288
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'Lasernet 7 NetsShare:3288'
}

define service {
use generic-service
host_name DOCPOINT
service_description Lasernet 7 HandleMails:3289
check_command check_nt!SERVICESTATE!-d SHOWALL -l 'Lasernet 7 HandleMails:3289'
}
Looking back at your previous post, these likely aren't working because you are missing () around the service names, should be the following based on the picture of your service list

Code: Select all

define service {
        use                     generic-service 
        host_name               DOCPOINT
        service_description     Lasernet 7 NetsShare 3288
        check_command           check_nt!SERVICESTATE!-d SHOWALL -l 'Lasernet 7 (NetsShare:3288)'
        }

define service {
        use                     generic-service 
        host_name               DOCPOINT
        service_description     Lasernet 7 HandleMails:3289
        check_command           check_nt!SERVICESTATE!-d SHOWALL -l 'Lasernet 7 (HandleMails:3289)'
        }

Re: Add more services to Nagios Core vers. 4.3.2

Posted: Mon Oct 02, 2017 3:29 am
by michaelpn
Hi scottwilkerson,

indeed you are right. That solved problem. I had forgotten the parenthesis. Many thanks for your observation. I appreciate very much that.

Re: Add more services to Nagios Core vers. 4.3.2

Posted: Mon Oct 02, 2017 8:59 am
by kyang
Sounds great! I'll be closing this topic as resolved!

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forum!