Good evening to all!
I was wondering around to find solution of mass acknowledging the alerts all at once for 500+ service notification in Nagios. After a long hardship, I came across building below script own. Please help in analyzing pros and cons or if another best alternative available to it.
#!/bin/sh
for name in $(cat list.txt)
do
domainname=$name
now=`date +%s`
command="/var/spool/nagios/cmd/nagios.cmd"
service=blacklist-check
#The show begins
/usr/bin/printf "[%lu] ACKNOWLEDGE_SVC_PROBLEM;$domainname;$service;2;1;1;mail_it;Should be de-listed in 1 week till 18 Nov, 2021.\n" $now >> $command
echo "$name ACKNOWLEDGED! "
done
echo "ALL COMPLETED"
Early reply will be appreciable.
Thanking You
Regards, Nishi