Nagios change Rule

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
PhumeleleSJose96
Posts: 13
Joined: Mon Feb 14, 2022 5:39 am

Nagios change Rule

Post 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
Last edited by PhumeleleSJose96 on Tue May 31, 2022 11:41 pm, edited 1 time in total.
PaulRajeshMEzra45
Posts: 11
Joined: Wed Feb 16, 2022 2:47 am

Re: Nagios change Rule

Post 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.
Last edited by PaulRajeshMEzra45 on Tue Jul 12, 2022 7:25 am, edited 2 times in total.
JamesZimmerman
Posts: 10
Joined: Wed Mar 23, 2022 8:00 am

Re: Nagios change Rule

Post 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
Last edited by JamesZimmerman on Wed Jul 20, 2022 12:46 am, edited 1 time in total.
StanGilbertlandria
Posts: 6
Joined: Sat Mar 26, 2022 2:24 am

Re: Nagios change Rule

Post 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?
Last edited by StanGilbertlandria on Wed Jun 22, 2022 6:15 am, edited 1 time in total.
CarolBrusteredman
Posts: 8
Joined: Tue Mar 22, 2022 5:50 am

Re: Nagios change Rule

Post 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?
Locked