Mass Acknowledge a Service

mail at catsnest.co.uk mail at catsnest.co.uk
Wed May 18 10:09:33 CEST 2011


If you are happy to use a dirty script instead of the gui you can just
use the external command listener file:
I use a script like this:
I would need updating for your needs but works quite well...

=====================================================
#!/bin/bash
nagiosLog="/opt/nagios/var/nagios.log"
nagiosCommand="/opt/nagios/var/rw/nagios.cmd"

now=`perl -e "print time;"`
OS=`uname -s`;
ORIG_IFS=$IFS ; IFS=$'\n'

 for check in $(grep "CURRENT SERVICE STATE"  $nagiosLog |grep
"windows_updates" | nawk -F": " '{print $2}' |sort -u ) ; do
   echo $check | nawk -F";" -v now=$now '{
    printf( "[%u]
ACKNOWLEDGE_SVC_PROBLEM;"$1";"$2";2;1;0;admin;Awating Patching\n", now
)
   }' >> $nagiosCommand
 done


IFS=$ORIG_IFS
=====================================================
--
Ritchie

On Tue, May 17, 2011 at 7:00 PM, steve f <a31modela at hotmail.com> wrote:
> I have a check that checks the size of multiple partitions and we recently
> added some data that surpassed the threshold value and I have over 100
> clients alerting.  There is nothing I can do about the space issue, it will
> go back to normal in a few weeks.
>
> Is it possible to acknowledge all 100 at once?  I do have a service group
> associated with this check but dont see that it can be ack'ed all at once.
> Is it possible to edit the status.dat file with a reference to a host group
> instead of a host name to accomplish this? :
>
> servicecomment {
>         host_name=strxxxxxxxx
>
>        host_group = GROUPNAME HERE
>
>         service_description=Legacy Partition Size
>         entry_type=4
>         comment_id=129
>         source=0
>         persistent=0
>         entry_time=1305654252
>         expires=0
>         expire_time=0
>         author=Nagios Admin
>         comment_data=known issue
>         }
>
>
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting
> any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>

------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list