Page 1 of 1

Select services to force checks

Posted: Mon Apr 23, 2018 2:04 am
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

Re: Select services to force checks

Posted: Mon Apr 23, 2018 12:45 pm
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/

Re: Select services to force checks

Posted: Tue Apr 24, 2018 2:19 am
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...

Re: Select services to force checks

Posted: Tue Apr 24, 2018 2:02 pm
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.

Re: Select services to force checks

Posted: Tue May 08, 2018 11:24 am
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

Re: Select services to force checks

Posted: Tue May 08, 2018 11:36 am
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.

Re: Select services to force checks

Posted: Fri May 11, 2018 3:02 am
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.

Re: Select services to force checks

Posted: Fri May 11, 2018 3:15 pm
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.

Re: Select services to force checks

Posted: Wed Jun 13, 2018 2:36 am
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.

Re: Select services to force checks

Posted: Wed Jun 13, 2018 8:39 am
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