Hello people !
I have a csv list of hosts of which I have to change the events handler to every services affected to them.
I have that script for the moment :
#!/bin/bash
CLAPI=/usr/share/centreon/bin/centreon
INPUT=/root/serverlist.csv
USER=admin
PASS=password
OLDIFS=$IFS
IFS=$';'
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read name
do
$CLAPI -u $USER -p $PASS -o SERVICE -a setparam -v "$name;$service;event_handler;event-handler-name"
done < $INPUT
IFS=$OLDIFS
So, the problem is that I can’t find a way to get all service name from the hosts in the $service variable, every command I tried for that is giving me too much information and not only the service name.
Do you have any idea ?
Thanks a lot !