We've moved to a new support system!

The Nagios Answer Hub is a place where you can get help with technical questions from our experts. There, you can quickly open tickets and join discussion boards.

Request Nagios Answer Hub access here: https://info.nagios.com/answer-hub-access-new-users

After completing the access form, you will be given access to a portal where new tickets can be created. We will keep the old customer forum sections and ticket system available for current cases to be resolved.

Go to the Answer Hub

Nagios change Rule

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Nagios change Rule

Postby PhumeleleSJose96 » Wed Apr 27, 2022 12:21 am

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

Re: Nagios change Rule

Postby PaulRajeshMEzra45 » Fri Apr 29, 2022 5:22 am

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.
Posts: 8
Joined: Wed Feb 16, 2022 2:47 am

Re: Nagios change Rule

Postby JamesZimmerman » Fri May 06, 2022 7:36 am

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.
Posts: 7
Joined: Wed Mar 23, 2022 8:00 am

Re: Nagios change Rule

Postby StanGilbertlandria » Tue May 10, 2022 12:11 am

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.
Posts: 4
Joined: Sat Mar 26, 2022 2:24 am

Re: Nagios change Rule

Postby CarolBrusteredman » Fri May 27, 2022 6:40 am

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?
Posts: 6
Joined: Tue Mar 22, 2022 5:50 am

Return to Community Support

Who is online

Users browsing this forum: Marco_34 and 23 guests