Page 1 of 1

Setting up one service with multiple checks

Posted: Tue Jun 10, 2014 2:45 pm
by akepley
I need to setup a service to check 3 different MySQL replication services (slave IO, lag, replication) and have it send an email to our help desk to automatically open a ticket when one of the 3 is failing. The reason for all 3 in one service is so Nagios doesn't open 3 separate tickets for the same issue. Is this possible?

Re: Setting up one service with multiple checks

Posted: Tue Jun 10, 2014 11:10 pm
by Box293
I had a look at the check_mysql_health plugin and it appears that it will only do one check when it runs, so out of the box this is not possible.

However you could write a wrapper script that executes all three checks. The wrapper detects if any one of the three checks fails the parameters you specify. This way you end up with one service and only one ticket generated in your helpdesk system.

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 4:07 am
by Stuart Watts
I can't recommend check_multi enough for this sort of situation!

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 10:56 am
by technick
BPI would be a perfect fit for this as well.

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 11:33 am
by akepley
I'm not familiar with "BPI". What is that?

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 11:50 am
by technick
Nagios Business Process Intelligence

For this specific use case, I would create three separate checks that does not notify. Then create a BPI group with those three services with a critical notification of anything below 100 percent. After that, you'll create another service check that runs against the BPI group and will notify you when the availability drops below 100%.

http://assets.nagios.com/downloads/nagi ... _Addon.pdf

I will tell you that the documentation is lacking in some areas and I had to "experiment" with it before fully understanding its abilities.

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 11:51 am
by tmcdonald
Slightly better version of that doc: http://assets.nagios.com/downloads/nagi ... BPI_v2.pdf

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 1:26 pm
by akepley
Set it up and setup some services in a new BPI Group. Then created a service with the BPI Wizard. Now the service is listed as "Unknown BPI Group Index" status. I've looked at the documentation and google with no results. What is the problem with that service?

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 3:34 pm
by technick
I probably didn't explain it great enough detail and this is the biggest thing missing from documentation..

Step 1. Create the service checks you want to be a part of this BPI group.

Step 2. Create your BPI Group
- You should be able to see the BPI group and when you expand it, you should see the services you added when you created the group. If you can't see your services in the group, you'll need to edit the bpi config and get them added.

Step 3. Create a new service check that will check the status of the BPI group.

Some recommendations... do not use spaces in the Group ID field, underscores work better. Display name doesn't matter since the check_bpi plugin attaches directly to the Group ID. I've also found that using Wizards can over complicate things and prefer personally to create everything manually and I recommend everybody does the same.

Re: Setting up one service with multiple checks

Posted: Wed Jun 11, 2014 3:54 pm
by akepley
Looks to be working perfectly. Thanks all!