NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
182 stars 94 forks source link

NCPA: check_passive #384

Closed pilot513 closed 7 years ago

pilot513 commented 7 years ago

Hello.
Let me ask you a question. I have a problem ... On the server that is monitored in the passive mode, given commands:

`[passive checks]

%HOSTNAME%|HOST = system/agent_version %HOSTNAME%|CPU.Usage = cpu/percent --warning 85 --critical 90 --aggregate avg %HOSTNAME%|Swap.Usage = memory/swap --warning 5 --critical 10 --units Gi %HOSTNAME%|Memory.Usage = memory/virtual --warning 92 --critical 98 --units Gi %HOSTNAME%|Process.Count = processes --warning 500 --critical 600 %HOSTNAME%|Vol.root.used_percent = /disk/logical/|/used_percent --warning 85 --critical 90 %HOSTNAME%|Net.Bytes.sent = /interface/enp0s3/bytes_sent %HOSTNAME%|Net.Bytes.recv = /interface/enp0s3/bytes_recv ` In config file /usr/local/ncpa/etc/ncpa.cfg defined the "sleep (default)" sleep 300

Why when the status of the service is critical, I receive notices on the email with an interval of 300 seconds (5 minutes). When I set sleep 600 - I start receiving notifications at intervals of 600 sec (10 min) ?

In Nagios4 (4.3.2) set defenition on the passive checks " notification_interval 90". Why it not override ? `define service{ name generic-service active_checks_enabled 1
passive_checks_enabled 1
parallelize_check 1
obsess_over_service 1
check_freshness 0
notifications_enabled 1
event_handler_enabled 1
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
is_volatile 0
check_period 24x7
max_check_attempts 3
check_interval 10
retry_interval 2
contact_groups smbp-Core-Team
notification_options w,u,c,r
notification_interval 60
notification_period 24x7
register 0
}

define service { name ncpa-passive-service use generic-service service_description NCPA passive service check max_check_attempts 5 check_interval 5 retry_interval 1 check_period 24x7 active_checks_enabled 0 passive_checks_enabled 1 parallelize_check 1 is_volatile 1 obsess_over_service 0 check_freshness 1 freshness_threshold 300 notification_interval 90 notification_period 24x7 register 0`

define command { command_name check_ncpa command_line $USER1$/check_ncpa.py -H $HOSTADDRESS$ $ARG1$ }

define service { use ncpa-passive-service,srv-pnp host_name itg7sql74 service_description CPU.Usage check_command check_ncpa!-t 'mytocken' -P 5693 -M cpu/percent -w 80 -c 90 -q 'aggregate=avg' max_check_attempts 3 check_interval 3 retry_interval 1 check_period 24x7 notification_interval 120 notification_period 24x7 notifications_enabled 1 }

Can you help me ?

pilot513 commented 7 years ago

/usr/lib64/nagios/plugins/check_ncpa.py -V

check_ncpa.py, Version 1.1.1

pilot513 commented 7 years ago

It seems, I understood why so ... is_volatile 1 shuld be "0"

jomann09 commented 7 years ago

Does it work when you change the is_volatile option? From checking here https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/volatileservices.html I see that it overrides the notification_interval option and sends them on non-OK states.

pilot513 commented 7 years ago

Yes. Exactly. I also read this material and after that I adjusted the setting.

jomann09 commented 7 years ago

Great, glad you have it figured out! Just a side note, you can also specify the sleep per passive check by doing:

%HOSTNAME%|Net.Bytes.recv|120 = /interface/enp0s3/bytes_recv

Would give the bytes_recv check a sleep value of 120, in case you need passive checks at different intervals! I'm going to close this now, but feel free to ask another question if you have any problems in the future.