Select services to force checks

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
fpernet
Posts: 55
Joined: Tue Aug 23, 2011 3:40 am

Select services to force checks

Post by fpernet »

Hi All,
I would consider a godd idea if we can from the All Service Problems for instance, to be able to Force an immediate check on all of these problems.
This Button ? could also be usefull on a result window when we select only some services by using the filter field.
This avoid to go from service to service to force the check ...

Thx
kyang

Re: Select services to force checks

Post by kyang »

Hello,

I don't know if you're using Nagios Core or Nagios XI.

In Nagios XI there is the Mass Acknowledge Component that allows you to scheduled an immediate check in bulk to hosts/services.

https://labs.nagios.com/2014/01/29/usin ... nagios-xi/
fpernet
Posts: 55
Joined: Tue Aug 23, 2011 3:40 am

Re: Select services to force checks

Post by fpernet »

Hi Kyang,

Thank you. I was speaking about NagiosXI, i should have specified. You're right ... but the goal is to have a button on the filtered services page, or All Service Problems page, in order to be able to refresh the services in one click.
Mass Acknowledge, AFAIK, oblige me to reselect all services i want to refresh...
kyang

Re: Select services to force checks

Post by kyang »

Thank you for the explanation.

I saw a while back there was a feature request to actually create a component that would allow you to check off each host/service and do specific things instead of finding each host/service.

Some of the examples listed were for "Force an immediate check" and "Disable notifications", of course those were just examples and more could potentially be added if the feature request is implemented.

As for having it on the "All service problems page", I would think it would just tie back into the component i mentioned above.
User avatar
Bryan Quesada
Posts: 6
Joined: Wed Nov 05, 2014 10:23 am
Location: Costa Rica
Contact:

Re: Select services to force checks

Post by Bryan Quesada »

With this script you can force the service check and also force all the services of a host.

For example:

Code: Select all

#!/bin/bash
#Develop test: bryan@gridshield.net | Bryan Quesada

command_file=`grep "^command_file=" /etc/nagios/nagios.cfg | cut -d "=" -f 2`

function reschedule() {

stamp=`date +%s`
naghost=$1
service="Retrieve"

#send command

echo "[$stamp] SCHEDULE_FORCED_SVC_CHECK;$naghost;$service;$stamp" >> $command_file
echo "Enviando host:  $naghost servicio: $service "
sleep 1
echo " force the service from host:  $naghost servicio: $service"

} 

cont=0
### loop
for host in $*
    do
      if [[ $cont -le $# ]]; then
         #echo $host
         reschedule $host

      fi
        cont=`expr $cont + 1`
   done

#  SEND el RE-SCHEDULE para el host ICA011

##  force all the services of a host

stamp=`date +%s`
host_ica="TEST"

# retry #1
echo " send host: $host_ica "
echo "[$stamp] SCHEDULE_FORCED_HOST_SVC_CHECKS;$host_ica;$stamp" >> $command_file
sleep 5

#  retry #2

stamp=`date +%s`
echo "[$stamp] SCHEDULE_FORCED_HOST_SVC_CHECKS;$host_ica;$stamp" >> $command_file
sleep 1

###### Example execution
./send_commands.sh hostA hostB hostC hostD hostE hostH hostR hostS
Last edited by Anonymous on Tue May 08, 2018 11:35 am, edited 1 time in total.
Reason: code blocks :)
kyang

Re: Select services to force checks

Post by kyang »

Thanks for the help @Bryan Quesada!

@fpernet, take a look at the bash script!

Let us know if you have any more questions.
fpernet
Posts: 55
Joined: Tue Aug 23, 2011 3:40 am

Re: Select services to force checks

Post by fpernet »

Yes thank you @Bryan Quesada!
But as standed my post was to ask for a new feature (request for enhancement). Please take this demand into account for next releases, if you think it is pertinent.
Many thanks everybody for your help and support.
You can close this ticket.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Select services to force checks

Post by scottwilkerson »

@fpernet

Yes. We actually have a feature request already for this to add in functionality to those pages to allow you to take actions in bulk.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
JoyYY
Posts: 1
Joined: Thu Feb 08, 2018 7:50 am

Re: Select services to force checks

Post by JoyYY »

I saw a while back there was a feature request to actually create a component that would allow you to check off each host/service and do specific things instead of finding each host/service.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Select services to force checks

Post by scottwilkerson »

JoyYY wrote:I saw a while back there was a feature request to actually create a component that would allow you to check off each host/service and do specific things instead of finding each host/service.
Yes this feature request already exists
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked