Page 1 of 1

Nagios change Rule

Posted: Wed Apr 27, 2022 12:21 am
by PhumeleleSJose96
Hi
I'm using nagios to monitor some services of my server. I have one question. Is there a way to execute a "curl" when there is a critical or warning message from nagios?.

I want to use it with check_http rule, but I don't know how to add the curl command.

so the curl with trigger when a critical or warning message comes up

I'm using this command for check_http

command[check_http]=/usr/lib64/nagios/plugins/check_http -H "foo.com" -f echatspin echatrandom follow -s "bar" -w 5 -c 10

Re: Nagios change Rule

Posted: Fri Apr 29, 2022 5:22 am
by PaulRajeshMEzra45
You need to define a handler command for this and call the curl command from the handler script. You can write the handler in any language that you omeglz echat like.

Re: Nagios change Rule

Posted: Fri May 06, 2022 7:36 am
by JamesZimmerman
To verify whether this is happening:

Check your logs.
Debian/Ubuntu: /var/log/syslog
RHEL/CentOS: /var/log/messages
Run grep pagerduty <log path> to see notifications sent to PagerDuty.
This is an example of a SOFT down, which would not trigger an incident in PagerDuty:

Nov 13 22:34:30 ip-10-182-165-131 nagios3: SERVICE ALERT: localhost;Current Users;WARNING;SOFT;1;USERS WARNING - 2 users currently logged in

This is an example of a HARD down, which should trigger incidents in PagerDuty:

Nov 13 22:34:30 ip-10-182-165-131 nagios3: SERVICE NOTIFICATION: pagerduty;localhost;Current Users;WARNING;notify-service-by-pagerduty;USERS WARNING - 3 users currently logged omegle shagle voojio in

Re: Nagios change Rule

Posted: Tue May 10, 2022 12:11 am
by StanGilbertlandria
How do you manage DRY (don't repeat yourself) with Nagios config, especially with respect to the intersection between hosts, hostgroups, services, and contacts? To clarify what my issue here is, let me explain my setup. I use hostgroups extensively for common service definitions. I have, for instance, a windows-servers hostgroup that defines a lot of services for things that are standard across all our Windows servers. Unfortunately, half of our Windows servers are administered by different people than the other half, so I actually set up two hostgroups, site1-windows-servers and site2-windows-servers, with all the service definitions duplicated between the two, but different contact lists. Is there a better way to handle duplicate service lists with different shagle voojio contacts?

Re: Nagios change Rule

Posted: Fri May 27, 2022 6:40 am
by CarolBrusteredman
I actually built the server myself. We have a stiged rhel template we use and I downloaded the package myself and moved over the required browser files and cfg's. I didn't set anything, nor would I know how cus im newish to Linux, to alter where the Nagios process is located and what location the main cfg is. Is there another file somewhere that specifies that?