Add more services to Nagios Core vers. 4.3.2

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.
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Add more services to Nagios Core vers. 4.3.2

Post 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 ?
Attachments
Nagios service Interface.odt
(394.88 KiB) Downloaded 197 times
hostgroups (kopi).cfg
(14.95 KiB) Downloaded 456 times
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Add more services to Nagios Core vers. 4.3.2

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Add more services to Nagios Core vers. 4.3.2

Post by michaelpn »

Hi scottwilkerson,

not understood ?
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Add more services to Nagios Core vers. 4.3.2

Post 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.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Add more services to Nagios Core vers. 4.3.2

Post 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)'
        }
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
michaelpn
Posts: 54
Joined: Fri Jul 14, 2017 12:12 am

Re: Add more services to Nagios Core vers. 4.3.2

Post 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.
Michael Pierre
Forenede Gruppeliv
2500 Valby
Copenhagen
kyang

Re: Add more services to Nagios Core vers. 4.3.2

Post 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!
Locked