Page 1 of 1

CRL

Posted: Thu Oct 01, 2020 4:26 am
by shaid-comda
Hi ,

i'm trying to use the plugin check_crl with no luck, it gave me a result based on 1.1.1970 , so the result for the command is

CRITICAL CRL (SHA256) Expire Time: -18536 Day, -6 Hour, -33 Minute and -18 Second

we are publishing new crl every 30 minutes and every 2 hours for some of them .

i found the parameter for that 2 hours = 7200 sec and 30 minutes = 1800 sec

how can i manage the nagios to work ? i have this plugin installed for years on an old configuration and it work perfectly .

i'm sure i missing something but i don't now what

thank you for your help

Re: CRL

Posted: Thu Oct 01, 2020 5:08 pm
by benjaminsmith
Hi,

There may be issue with check results on this system. What version of Nagios XI are you running and what operating system?

Can you run the plugin directly from the command line and get valid results?

The following kb article has instructions for testing out check commands directly from the shell.

Nagios XI - How To Test Check Commands From The Command-line

Regards,
Benjamin

Re: CRL

Posted: Tue Oct 06, 2020 7:56 am
by shaid-comda
Hi Benjamin,

we managed to change the script and now it's ok . we still have another problem with the notification , we send sms through an api in case of alert. it's working for the host , but not for his services . it's very strange in case of a service failure we get an sms that the host is ok ...
the email is ok we got the right info
but not the sms is about the host status

Do you have any idea what it could be ?

thank you for your help

Re: CRL

Posted: Tue Oct 06, 2020 5:20 pm
by benjaminsmith
Hi,
we managed to change the script and now it's ok
Great! Glad to hear you got it working.

As far as not getting SMS alerts for services, there are user-level notification preferences, please double-check those settings for your user account. Click on the account name in the upper right and select Notification Preferences.
notification-preferences.png
If that's not it, please let me know the exact name of the service along with the contacts who should receive the SMS notification and I can check configurations in the system profile.

Thanks,
Benjamin

To send us your system profile.
Login to the Nagios XI GUI using a web browser.
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share in a private message or upload it to the post/ticket, and then reply to this post to bring it up in the queue.

Re: CRL

Posted: Wed Oct 07, 2020 3:36 am
by shaid-comda
hi Benjamin

i sent everything through a pm,

regards

Re: CRL

Posted: Wed Oct 07, 2020 5:00 pm
by benjaminsmith
Hi,

Perfect, thank you. The host and service configurations look good, but I noticed some of the contacts have different motivation handlers. Depending on how you have configured the SMS alerts, this would cause a different behavior between the contacts assigned the services (associated with this host).

For example, this contact has the default xi notification handlers set.

Code: Select all

define contact {
	contact_name	stefanc
	service_notification_period	stefanc_notification_times
	host_notification_period	stefanc_notification_times
	service_notification_options	r,w,u,c,f,s
	host_notification_options	r,d,u,f,s
	service_notification_commands	xi_service_notification_handler
	host_notification_commands	xi_host_notification_handler
While this contact has those handlers plus the default core commands (Sendmail) along with SMS notification handlers.

Code: Select all

define contact {
	contact_name	erico
	service_notification_period	xi_timeperiod_24x7
	host_notification_period	xi_timeperiod_24x7
	service_notification_options	r,w,u,c,f,s
	host_notification_options	r,d,u,f,s
	service_notification_commands	xi_service_event_handler,service-notify-by-sms,notify-service-by-email
	host_notification_commands	xi_host_event_handler,notify-host-by-email,Host-notify-by-sms
After making changes, you can test the notifications by sending passive check results to the service and forcing a notification by putting the service in a non-ok state ( see below). Run the following command to watch the nagios.log and mail logs for the appropriate entries.

Code: Select all

tail -F /var/log/maillog /usr/local/nagiosxi/tmp/phpmailer.log /usr/local/nagiosxi/var/eventman.log
passive-checks.png
How to submit passive results for testing:
For Hosts
------------

Go to Home > Service Status:
- Find the Service and click on it
- Click the + tab
- Click the "Submit passive check result" link
- Select the Check Result and type in some text for the Check Output
- Click the Submit button

NOTE: By default, passive_host_checks_are_soft=0 is set in your /usr/local/nagios/etc/nagios.cfg, this differs from services in that when you submit a passive host check result it immediately goes into a HARD state (and should send a notification if configured to) instead of going into a SOFT state like services do. (notifications are only sent on HARD states).

For Services
----------------

Go to Home > Service Status:
- Find the Service and click on it
- Click the + tab
- Note these two rows:

State Type: Hard
Current Check: 1 of 4

Those columns tell the current State Type and the Current Check number. In order to generate a notification for a service, you will need to submit MULTIPLE problem check results (the number that you need to submit is determined by the last number in the Current Check column, which is the max_check_attempts setting). For services, when you submit a passive check result, each result that you submit will be a SOFT state until you submit enough to hit the Max Check Attempts setting that you've defined on the service, only then will the service enter a HARD problem state which will generate the notification (just remember, notifications are only sent on HARD states).

- Click the "Submit passive check result" link
- Select the Check Result and type in some text for the Check Output
- Click the Submit button
- Submit as many as you need, right after another, until the service enters the HARD state so that a notification will be sent