nagios config file processes

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.
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

nagios config file processes

Post by vvz »

Hi!

I have Nagios 3.5.1 running on CentOS 6.7

I run command ps aux in command line and got output (just part of command output related to nagios):
nagios 46338 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46339 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46340 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46341 0.0 0.0 109488 956 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.145 -w 300.0,80% -c 500.0,100% -p 5
nagios 46342 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46343 0.0 0.0 109488 956 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.172 -w 300.0,80% -c 500.0,100% -p 5
nagios 46344 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46345 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.132 -w 300.0,80% -c 500.0,100% -p 5
nagios 46346 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46347 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46348 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.133 -w 300.0,80% -c 500.0,100% -p 5
nagios 46349 0.0 0.0 109488 964 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.138 -w 300.0,80% -c 500.0,100% -p 5
nagios 46350 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46351 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.139 -w 300.0,80% -c 500.0,100% -p 5
nagios 46352 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46353 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.169 -w 300.0,80% -c 500.0,100% -p 5
nagios 46354 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46355 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46356 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46357 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.142 -w 300.0,80% -c 500.0,100% -p 5
nagios 46358 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.38 -w 300.0,80% -c 500.0,100% -p 5
nagios 46359 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 46360 0.0 0.0 6412 660 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.145
nagios 46361 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.40 -w 300.0,80% -c 500.0,100% -p 5
nagios 46362 0.0 0.0 6412 660 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.138
nagios 46363 0.0 0.0 6412 664 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.132
nagios 46364 0.0 0.0 6412 660 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.133
nagios 46365 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.37 -w 300.0,80% -c 500.0,100% -p 5
nagios 46366 0.0 0.0 6412 660 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.169
nagios 46367 0.0 0.0 6412 660 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.172
nagios 46368 0.0 0.0 6412 664 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.139
nagios 46369 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.68 -w 300.0,80% -c 500.0,100% -p 5
nagios 46370 0.0 0.0 109488 960 ? S 14:32 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.69 -w 300.0,80% -c 500.0,100% -p 5
nagios 46371 0.0 0.0 6412 664 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.38
nagios 46372 0.0 0.0 6412 660 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.40
nagios 46373 0.0 0.0 6412 660 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.142
nagios 46374 0.0 0.0 6412 664 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.37
nagios 46375 0.0 0.0 6412 664 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.68
nagios 46376 0.0 0.0 6412 664 ? S 14:32 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.69
My question about line (reading main config):
nagios 46338 0.0 0.0 205680 1844 ? S 14:32 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg

Should I have so many processes related to main config reading? Is it normal? I didn't remark this before.

Thank you
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: nagios config file processes

Post by tgriep »

That does seem to to many nagios processes running.
If you stop the nagios processes and kill off the extras, do they come back when you start the pagios process?
If so, can you post your nagios.cfg file so we can check it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: nagios config file processes

Post by vvz »

I killed all nagios processes.

Looks like it's better now

output of ps aux | grep nagios
nagios 21146 0.1 0.0 140172 2540 ? Ssl 15:50 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nrpe 21529 0.0 0.0 41468 1420 ? Ss 15:51 0:00 /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d
nagios 22020 0.0 0.0 140176 1752 ? S 15:53 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 22021 0.0 0.0 140176 1752 ? S 15:53 0:00 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
nagios 22022 0.0 0.0 109488 960 ? S 15:53 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.139 -w 300.0,80% -c 500.0,100% -p 5
nagios 22023 0.0 0.0 109488 960 ? S 15:53 0:00 /usr/lib64/nagios/plugins/check_ping -H 172.16.37.133 -w 300.0,80% -c 500.0,100% -p 5
nagios 22024 0.0 0.0 6412 664 ? S 15:53 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.139
nagios 22025 0.0 0.0 6412 660 ? S 15:53 0:00 /bin/ping -n -U -w 10 -c 5 172.16.37.133
root 22307 0.0 0.0 103244 884 pts/3 S+ 15:53 0:00 grep nagios
As you can see still 3 processes with main config
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: nagios config file processes

Post by vvz »

Here it is my main config

Code: Select all

log_file=/var/log/nagios/nagios.log


cfg_file=/etc/nagios/objects/commands.cfg
cfg_file=/etc/nagios/objects/templates/templates.cfg
cfg_file=/etc/nagios/objects/contacts.cfg
cfg_file=/etc/nagios/objects/services/critical/cassandra-nodes-status.cfg
cfg_file=/etc/nagios/objects/services/critical/check-host-alive.cfg
cfg_file=/etc/nagios/objects/services/critical/check-probes-ptd-connection.cfg
cfg_file=/etc/nagios/objects/services/critical/check-mblog-if-smsc-down-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/check-ptd-queue-is-full-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/check-ssh.cfg
cfg_file=/etc/nagios/objects/services/critical/condor-stp-sctp-association-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/currentLoad-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/currentLoad-status-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/dataPartition-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/dataPartition-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/dimm-status-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/dimm-status-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/elsalto-stp-sctp-association-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/fans-status-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/fans-status-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/gateway-thread-number.cfg
cfg_file=/etc/nagios/objects/services/critical/gateways-balance.cfg
cfg_file=/etc/nagios/objects/services/critical/memory-usage.cfg
cfg_file=/etc/nagios/objects/services/critical/mo-received.cfg
cfg_file=/etc/nagios/objects/services/critical/number-nagios-processes-running.cfg
cfg_file=/etc/nagios/objects/services/critical/number-bash-processes-running.cfg
cfg_file=/etc/nagios/objects/services/critical/number-smg1-process-running.cfg
cfg_file=/etc/nagios/objects/services/critical/number-smg2-process-running.cfg
cfg_file=/etc/nagios/objects/services/critical/number-gw-process-running.cfg
cfg_file=/etc/nagios/objects/services/critical/powersupply-status-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/powersupply-status-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/processors-status-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/probes-balance.cfg
cfg_file=/etc/nagios/objects/services/critical/processors-status-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/rootPartition-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/rootPartition-status-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/SDP-files-problem.cfg
cfg_file=/etc/nagios/objects/services/critical/smg-out-messages-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/smsc-pingable-from-smg1-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/temperature-status-nrpe.cfg
cfg_file=/etc/nagios/objects/services/critical/temperature-status-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/ussdb-status.cfg
cfg_file=/etc/nagios/objects/services/critical/ussdb1-smg1-logs-growing.cfg
cfg_file=/etc/nagios/objects/services/critical/ussdb2-smg2-logs-growing.cfg
cfg_file=/etc/nagios/objects/services/critical/ussdgw-daemon-running.cfg
cfg_file=/etc/nagios/objects/services/critical/probe-router-traffic-passive.cfg
cfg_file=/etc/nagios/objects/services/critical/smg1-logs.cfg
cfg_file=/etc/nagios/objects/services/critical/smg2-logs.cfg
cfg_file=/etc/nagios/objects/services/critical/ws-response-status.cfg
cfg_file=/etc/nagios/objects/services/warning/cassandra-latency.cfg
cfg_file=/etc/nagios/objects/services/warning/legacy-mb-OUT.cfg
cfg_file=/etc/nagios/objects/services/warning/net-info-logs.cfg
cfg_file=/etc/nagios/objects/services/warning/reminder.cfg

cfg_file=/etc/nagios/objects/timeperiods.cfg
cfg_file=/etc/nagios/objects/hosts/currentLoad-hostgroup.cfg
cfg_file=/etc/nagios/objects/hosts/hardware-status-hostgroup.cfg
cfg_file=/etc/nagios/objects/hosts/hardware-status-passive-hostgroup.cfg
cfg_file=/etc/nagios/objects/hosts/hostgroup-concert-site.cfg
cfg_file=/etc/nagios/objects/hosts/hostgroup-condor-site.cfg
cfg_file=/etc/nagios/objects/hosts/hostgroup-elsalto-site.cfg
cfg_file=/etc/nagios/objects/hosts/hosts.cfg
cfg_file=/etc/nagios/objects/hosts/rootPartition-hostgroup.cfg
cfg_file=/etc/nagios/objects/hosts/root-partition-passive-hostgroup.cfg

cfg_dir=/etc/nagios/conf.d
object_cache_file=/var/log/nagios/objects.cache
precached_object_file=/var/log/nagios/objects.precache
resource_file=/etc/nagios/private/resource.cfg
status_file=/var/log/nagios/status.dat
status_update_interval=10
nagios_user=nagios
nagios_group=nagios
check_external_commands=1
command_check_interval=-1
command_file=/var/spool/nagios/cmd/nagios.cmd
external_command_buffer_slots=4096
lock_file=/var/run/nagios.pid
temp_file=/var/log/nagios/nagios.tmp
temp_path=/tmp
event_broker_options=-1
log_rotation_method=d
log_archive_path=/var/log/nagios/archives
use_syslog=1
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_external_commands=1
log_passive_checks=1
service_inter_check_delay_method=s
max_service_check_spread=30
service_interleave_factor=s
host_inter_check_delay_method=s
max_host_check_spread=30
max_concurrent_checks=100
check_result_reaper_frequency=10
max_check_result_reaper_time=30
check_result_path=/var/log/nagios/spool/checkresults
max_check_result_file_age=3600
cached_host_check_horizon=15
cached_service_check_horizon=15
enable_predictive_host_dependency_checks=1
enable_predictive_service_dependency_checks=1
soft_state_dependencies=0
auto_reschedule_checks=0
auto_rescheduling_interval=30
auto_rescheduling_window=180
sleep_time=0.25
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
retain_state_information=1
state_retention_file=/var/log/nagios/retention.dat
retention_update_interval=60
use_retained_program_state=1
use_retained_scheduling_info=1
retained_host_attribute_mask=0
retained_service_attribute_mask=0
retained_process_host_attribute_mask=0
retained_process_service_attribute_mask=0
retained_contact_host_attribute_mask=0
retained_contact_service_attribute_mask=0
interval_length=60
check_for_updates=1
bare_update_check=0
use_aggressive_host_checking=0
execute_service_checks=1
accept_passive_service_checks=1
execute_host_checks=1
accept_passive_host_checks=1
enable_notifications=1
enable_event_handlers=1
process_performance_data=0
obsess_over_services=0
obsess_over_hosts=0
translate_passive_host_checks=0
passive_host_checks_are_soft=0
check_for_orphaned_services=1
check_for_orphaned_hosts=1
check_service_freshness=1
service_freshness_check_interval=60
service_check_timeout_state=c
check_host_freshness=0
host_freshness_check_interval=60
additional_freshness_latency=15
enable_flap_detection=0
low_service_flap_threshold=5.0
high_service_flap_threshold=20.0
low_host_flap_threshold=5.0
high_host_flap_threshold=20.0
date_format=us
p1_file=/usr/sbin/p1.pl
enable_embedded_perl=1
use_embedded_perl_implicitly=1
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
use_regexp_matching=0
use_true_regexp_matching=0
admin_email=nagios@localhost
admin_pager=pagenagios@localhost
daemon_dumps_core=0
use_large_installation_tweaks=0
enable_environment_macros=1
debug_level=0
debug_verbosity=1
debug_file=/var/log/nagios/nagios.debug
max_debug_file_size=1000000
Last edited by tgriep on Mon Aug 15, 2016 3:09 pm, edited 1 time in total.
Reason: Moved large output to Code Wraps
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: nagios config file processes

Post by vvz »

and one more

when I put ps aux | grep nagios on watch

# watch -n2 'ps aux | grep nagios'

periodically I have the next line in output (not constantly)
nagios 35591 0.0 0.0 0 0 ? Z 16:24 0:00 [nagios] <defunct>
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: nagios config file processes

Post by vvz »

Actually it is just one Zombie so I don't really care about this defunct process
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: nagios config file processes

Post by tgriep »

The zombie process should be just a worker shutting down so that is normal.
Nothing in the nagios.cfg file looks wrong so keep an eye on the server and let us know if we can close this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: nagios config file processes

Post by vvz »

actually my question is - how many lines like underneath are acceptable? :
or another words - when this process created?
nagios 21146 0.1 0.0 205708 2660 ? Ssl 15:50 0:09 /usr/sbin/nagios -d /etc/nagios/nagios.cfg
because periodically I have 5-9 such lines in ps output, after a few second - just one
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: nagios config file processes

Post by tgriep »

When the server is not checking anything, there should be 2 processes running. One parent and one child.
When the server is busy, it will spawn more of them as needed and that number depends on how many checks are running at that moment, time it takes to run, etc.. but as long as they startup and shutdown, that number should be alright.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vvz
Posts: 187
Joined: Wed Oct 30, 2013 5:15 pm

Re: nagios config file processes

Post by vvz »

OK, thank you for you help

We can close the thread I guess
Locked