Multiple Nagios process running with different process ID

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.
Locked
Deepa
Posts: 10
Joined: Wed Apr 27, 2016 2:07 am

Multiple Nagios process running with different process ID

Post by Deepa »

Hello Guys,
I am having a script to add configuration file in nagios in which I do 'service nagios reload' command so that the configuration completes.But while running the script multiple times to do multiple configuration, sometimes Nagios is getting started with different process ID.This leads to instability in configuration(hosts/services may appear sometimes in nagios dashboard and may not in some other times - by referring each process ID at each time). How could I resolve this to continue with single Nagios process?


Thanks
Deepa
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Multiple Nagios process running with different process I

Post by dwhitfield »

Can you post the output of pstree -l? Please be sure to wrap the output in a code block.

Also, what version of Nagios Core are you using? If it is not 4.2.3, you should upgrade. On what OS/version are you running Nagios Core?

Lastly, please be aware that our office will be closed Thursday and Friday this week due to US Thanksgiving. Of course, community members will be able to contribute to the forum during that time.
Deepa
Posts: 10
Joined: Wed Apr 27, 2016 2:07 am

Re: Multiple Nagios process running with different process I

Post by Deepa »

Thanks for the immediate response.When I faced this issue I killed the duplicate nagios process.Now I am unable to reproduce it.I think its of no use to post the output of pstree -l when there is single process.But you can refer below.I will update it once the issue reoccurs.
Also I am using nagios4.1.1 version on CentOS6.8.Will update it soon and check.

Is there anyway to restrict multiple process of single service in configuration level?

Output:

Code: Select all

init─┬─acpid
     ├─agetty
     ├─auditd───{auditd}
     ├─dhclient
     ├─httpd───12*[httpd]
     ├─master─┬─pickup
     │        ├─qmgr
     │        └─tlsmgr
     ├─mingetty
     ├─mysqld_safe───mysqld───10*[{mysqld}]
     ├─nagios─┬─6*[nagios]
     │        ├─2*[nagios───check_ping───ping]
     │        └─nagios───check_nrpe
     ├─ndo2db───ndo2db───ndo2db
     ├─rsyslogd───3*[{rsyslogd}]
     ├─screen─┬─bash
     │        └─bash───python───2*[sudo]
     ├─sshd───sshd───bash───pstree
     ├─udevd───udevd
     └─xinetd
Thanks
Deepa
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Multiple Nagios process running with different process I

Post by dwhitfield »

That pstree looks normal (just wanted to make sure we were on the same page about that), but what you are experiencing does not sound normal. As you can see, Nagios is not the only thing with multiple processes. Could you post the plugin you are working on or a link to it so we can figure out why you are experiencing things not showing up?

I wasn't able to find any documentation on what you are trying to do, but I wonder if http://nagios-plugins.org/doc/guidelines.html will be helpful for you.

I did find a number of improvements in the service UI at https://github.com/NagiosEnterprises/na ... /Changelog but nothing that really seems like it is on point for what you are experiencing. Perhaps you could provide a two screenshots: one where things show up and one where things don't. That will help us pinpoint exactly what is going on. Thanks!
Deepa
Posts: 10
Joined: Wed Apr 27, 2016 2:07 am

Re: Multiple Nagios process running with different process I

Post by Deepa »

Since the issue is not reproducible, Am not able to give you the exact details to analyse.Even the screenshots that you have asked need that multiple process to be reproduced so that I can spot the error properly.So once I got that error surely will come up.Thank you so much for your response.

Can you help me in showing trends?Am not getting the monitoring trends for a particular service for which the rrd file is not getting generated(by the way Am using pnp4nagios plugin).

This is the output of the specific command:
command: ./check_nrpe -H 192.168.1.210 -c check_ps
output: OK - Process: congress, User: root, CPU: 0.7%, RAM: 0.0%, Start: Dec07, CPU Time: 436 min | 'cpu'=0.7 'memory'=0.0 'cputime'=436 ]


Thanks
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Multiple Nagios process running with different process I

Post by ssax »

Deepa, please create a new topic for your trends issue, we like to keep to one issue per topic/ticket so that we can refer back to them without confusion and also so they don't drag on forever.


Thank you
Deepa
Posts: 10
Joined: Wed Apr 27, 2016 2:07 am

Re: Multiple Nagios process running with different process I

Post by Deepa »

I got that multi-process issue. Here is the output of pstree command.The issue occurs when I do restart service nagios restartmanually not even through any script.

Code: Select all

init─┬─acpid
     ├─agetty
     ├─auditd───{auditd}
     ├─crond
     ├─dhclient
     ├─httpd───9*[httpd]
     ├─master─┬─cleanup
     │        ├─pickup
     │        ├─qmgr
     │        ├─smtp
     │        └─tlsmgr
     ├─mingetty
     ├─mysqld_safe───mysqld───15*[{mysqld}]
     ├─nagios───5*[nagios]
     ├─2*[nagios───4*[nagios]]
     ├─ndo2db───3*[ndo2db───ndo2db]
     ├─rsyslogd───3*[{rsyslogd}]
     ├─screen───bash───python───2*[sudo]
     ├─sshd─┬─sshd───bash───pstree
     │      └─sshd───bash
     ├─udevd───udevd
     └─xinetd
There are 3 process running with 4 to 5 child process.Whenever I do restart a new process is getting created.Please find the attachment of Nagios dashboard.
Attachments
Nagios Core.png
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Multiple Nagios process running with different process I

Post by dwhitfield »

Did you install once from repo and compile once from source? You mention you have 4.1.1 but your attachment shows you are running 4.0.8.

What's the output of rpm -qa nag*?
Deepa
Posts: 10
Joined: Wed Apr 27, 2016 2:07 am

Re: Multiple Nagios process running with different process I

Post by Deepa »

I did the installation from source not from repository.We have two Nagios set up, one with the version 4.1.1 and other with 4.0.8. Anyway we faced the issue in both.

The following is the output of rpm -qa nag*
nagios-plugins-disk_smb-2.0.3-3.el6.x86_64
nagios-common-3.5.1-1.el6.x86_64
nagios-plugins-by_ssh-2.0.3-3.el6.x86_64
nagios-plugins-http-2.0.3-3.el6.x86_64
nagios-plugins-2.0.3-3.el6.x86_64
nagios-plugins-oracle-2.0.3-3.el6.x86_64
nagios-plugins-game-2.0.3-3.el6.x86_64
nagios-plugins-ups-2.0.3-3.el6.x86_64
nagios-plugins-dns-2.0.3-3.el6.x86_64
nagios-plugins-log-2.0.3-3.el6.x86_64
nagios-plugins-file_age-2.0.3-3.el6.x86_64
nagios-plugins-fping-2.0.3-3.el6.x86_64
nagios-plugins-dummy-2.0.3-3.el6.x86_64
nagios-plugins-swap-2.0.3-3.el6.x86_64
nagios-plugins-dig-2.0.3-3.el6.x86_64
nagios-plugins-mysql-2.0.3-3.el6.x86_64
nagios-plugins-nrpe-2.15-7.el6.x86_64
nagios-plugins-flexlm-2.0.3-3.el6.x86_64
nagios-plugins-disk-2.0.3-3.el6.x86_64
nagios-plugins-time-2.0.3-3.el6.x86_64
nagios-plugins-mrtgtraf-2.0.3-3.el6.x86_64
nagios-plugins-load-2.0.3-3.el6.x86_64
nagios-plugins-cluster-2.0.3-3.el6.x86_64
nagios-plugins-mrtg-2.0.3-3.el6.x86_64
nagios-plugins-mailq-2.0.3-3.el6.x86_64
nagios-plugins-ntp-perl-2.0.3-3.el6.x86_64
nagios-plugins-ping-2.0.3-3.el6.x86_64
nagios-plugins-ldap-2.0.3-3.el6.x86_64
nagios-plugins-rpc-2.0.3-3.el6.x86_64
error: rpmdbNextIterator: skipping h# 450 region trailer: BAD, tag 18448 type 0 offset 0 count 0
nagios-plugins-tcp-2.0.3-3.el6.x86_64
nagios-plugins-breeze-2.0.3-3.el6.x86_64
nagios-plugins-wave-2.0.3-3.el6.x86_64
nagios-plugins-hpjd-2.0.3-3.el6.x86_64
nagios-plugins-ide_smart-2.0.3-3.el6.x86_64
nagios-plugins-ntp-2.0.3-3.el6.x86_64
nagios-plugins-ssh-2.0.3-3.el6.x86_64
nagios-plugins-icmp-2.0.3-3.el6.x86_64
nagios-plugins-nwstat-2.0.3-3.el6.x86_64
nagios-plugins-pgsql-2.0.3-3.el6.x86_64
nagios-plugins-ircd-2.0.3-3.el6.x86_64
nagios-plugins-overcr-2.0.3-3.el6.x86_64
nagios-plugins-nagios-2.0.3-3.el6.x86_64
nagios-plugins-dhcp-2.0.3-3.el6.x86_64
nagios-plugins-smtp-2.0.3-3.el6.x86_64
nagios-plugins-sensors-2.0.3-3.el6.x86_64
nagios-plugins-users-2.0.3-3.el6.x86_64
nagios-plugins-perl-2.0.3-3.el6.x86_64
nagios-plugins-procs-2.0.3-3.el6.x86_64
nagios-plugins-real-2.0.3-3.el6.x86_64
nagios-plugins-nt-2.0.3-3.el6.x86_64
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Multiple Nagios process running with different process I

Post by dwhitfield »

Looks like this was fixed in 4.1.2: https://github.com/NagiosEnterprises/na ... /issues/89

I would highly advise upgrading to 4.2.4. There are many security and bug fixes.
Locked