2 equal services on the same host

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

2 equal services on the same host

Postby h4doukeeN » Mon Sep 11, 2017 5:18 pm

Hello, I query on a server I have 2 services with the same name, today we had a fall and nagios was not able to report status, in the web interface you see that there are 2 services with the same name and in the service was added only once in the nagios CFG, as you could differentiate both the only thing I have are different ports of these services on the same host

Ex:

01-Sv-10.72
NSClient++ Version
Notifications for this service have been disabled
OK 09-11-2017 19:18:16 6d 5h 7m 40s 1/1 NSClient++ 0.5.0.62 2016-09-14
Servicio Ax32Serv
OK 09-11-2017 19:18:17 0d 7h 55m 24s 1/1 Ax32Serv.exe: Running, Ax32Serv.exe: Running
h4doukeeN
 
Posts: 31
Joined: Wed Aug 09, 2017 9:32 am

Re: 2 equal services on the same host

Postby tmcdonald » Tue Sep 12, 2017 2:26 pm

You could add the port to the end of the service description like some_service_100 and some_service_200 or whatever the ports are. Otherwise if it is one service assigned to two hosts it should be clear which one is having the issue because the hostname should be next to the service name.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Lead / Operations Engineer
 
Posts: 8679
Joined: Mon Sep 23, 2013 8:40 am

Re: 2 equal services on the same host

Postby h4doukeeN » Tue Sep 12, 2017 3:50 pm

tmcdonald wrote:You could add the port to the end of the service description like some_service_100 and some_service_200 or whatever the ports are. Otherwise if it is one service assigned to two hosts it should be clear which one is having the issue because the hostname should be next to the service name.


I will test and report, thank you very much
h4doukeeN
 
Posts: 31
Joined: Wed Aug 09, 2017 9:32 am

Re: 2 equal services on the same host

Postby h4doukeeN » Tue Sep 12, 2017 4:03 pm

h4doukeeN wrote:
tmcdonald wrote:You could add the port to the end of the service description like some_service_100 and some_service_200 or whatever the ports are. Otherwise if it is one service assigned to two hosts it should be clear which one is having the issue because the hostname should be next to the service name.


I will test and report, thank you very much


I think my question was not well understood or I did not understand the answer. as seen in the images in the host 01-Sv-10.72 is shown twice the same service and is because there are two services on the same host with the same name. What I need is to separate them that are not shown together or how to make nagios recognize that they are not the same since yesterday we had a fall and in that server that is added once in the cfg and shows 2 by the web did not pass the state a critical

Image
Image
h4doukeeN
 
Posts: 31
Joined: Wed Aug 09, 2017 9:32 am

Re: 2 equal services on the same host

Postby tmcdonald » Tue Sep 12, 2017 4:23 pm

Those are two separate services. One is called Servicio Ax32Serv and the other is called NSClient++ Version. The service_description field is the name of the service. The host_name is the host to which the service is attached.

I understand now. You mean "service" as in "services.msc" on the Windows machine, not a Nagios service. In this case unfortunately the plugin can only look at the service/process name, and if that is identical then Nagios has no way to differentiate them, unless you can somehow find the PID of each and make the distinction that way.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Lead / Operations Engineer
 
Posts: 8679
Joined: Mon Sep 23, 2013 8:40 am

Re: 2 equal services on the same host

Postby h4doukeeN » Tue Sep 12, 2017 4:28 pm

tmcdonald wrote:Those are two separate services. One is called Servicio Ax32Serv and the other is called NSClient++ Version. The service_description field is the name of the service. The host_name is the host to which the service is attached.

I understand now. You mean "service" as in "services.msc" on the Windows machine, not a Nagios service. In this case unfortunately the plugin can only look at the service/process name, and if that is identical then Nagios has no way to differentiate them, unless you can somehow find the PID of each and make the distinction that way.



ignores the NSClient, I only speak for Ax32Serv, it is 2 times on the same line 1-Ax32Serv: Running, 2- Ax32Serv: Running
h4doukeeN
 
Posts: 31
Joined: Wed Aug 09, 2017 9:32 am

Re: 2 equal services on the same host

Postby h4doukeeN » Tue Sep 12, 2017 4:41 pm

same services same server, I need to separate them to monitor them since both running does not warn if it falls one or the other I imagine that it will warn only if they fall the 2
Image
Image
h4doukeeN
 
Posts: 31
Joined: Wed Aug 09, 2017 9:32 am

Re: 2 equal services on the same host

Postby tacolover101 » Tue Sep 12, 2017 4:54 pm

h4doukeeN wrote:
tmcdonald wrote:Those are two separate services. One is called Servicio Ax32Serv and the other is called NSClient++ Version. The service_description field is the name of the service. The host_name is the host to which the service is attached.

I understand now. You mean "service" as in "services.msc" on the Windows machine, not a Nagios service. In this case unfortunately the plugin can only look at the service/process name, and if that is identical then Nagios has no way to differentiate them, unless you can somehow find the PID of each and make the distinction that way.



ignores the NSClient, I only speak for Ax32Serv, it is 2 times on the same line 1-Ax32Serv: Running, 2- Ax32Serv: Running


this usually means two processes are running at the same time. in the past though, i've seen this be a bug with NSClient++.
User avatar
tacolover101
 
Posts: 247
Joined: Mon Apr 10, 2017 11:55 am

Re: 2 equal services on the same host

Postby h4doukeeN » Wed Sep 13, 2017 6:23 am

tmcdonald wrote:Those are two separate services. One is called Servicio Ax32Serv and the other is called NSClient++ Version. The service_description field is the name of the service. The host_name is the host to which the service is attached.

I understand now. You mean "service" as in "services.msc" on the Windows machine, not a Nagios service. In this case unfortunately the plugin can only look at the service/process name, and if that is identical then Nagios has no way to differentiate them, unless you can somehow find the PID of each and make the distinction that way.


I found a way to do so I did some tests with another service and at the moment it goes well when I do on the server I will confirm. the method was to enter HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services

look for the service change the name to which we want to one of the obvious 2 and then enter the installation path and change the name also to start the service, for the changes to take effect restart the host and then edit the name of the service in the nagios CFG obviously.
I did the tests on my desktop host as I need it on a production server when I can reboot it I will do it and I will inform you if someone else can serve you.

I leave pictures as I use google translator to communicate with you and I speak Spanish. sorry for not being able to write better

Image
Image
Image
h4doukeeN
 
Posts: 31
Joined: Wed Aug 09, 2017 9:32 am

Re: 2 equal services on the same host

Postby tmcdonald » Wed Sep 13, 2017 11:43 am

Changing the name of the executable would certainly work, but I would caution people against this as changing the name could cause things to break if another process is expecting a certain name.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Lead / Operations Engineer
 
Posts: 8679
Joined: Mon Sep 23, 2013 8:40 am

Next

Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 23 guests