#!/usr/bin/env bash function cecho { while [ "$1" ]; do case "$1" in -normal) color="\033[00m" ;; -black) color="\033[30;01m" ;; -red) color="\033[31;01m" ;; -green) color="\033[32;01m" ;; -yellow) color="\033[33;01m" ;; -blue) color="\033[34;01m" ;; -magenta) color="\033[35;01m" ;; -cyan) color="\033[36;01m" ;; -white) color="\033[37;01m" ;; -n) one_line=1; shift ; continue ;; *) echo -n "$1"; shift ; continue ;; esac shift echo -en "$color" echo -en "$1" echo -en "\033[00m" shift done if [ ! $one_line ]; then echo fi } servers=( #art-decor.agence-esante.lu #art-decor.ihe-europe.net #data.ihe-europe.net #gazelle.ehdsi.ihe-europe.net #gazelle.agence-esante.lu #gazelle.ehealth.brussels #gazellecontent.sequoiaproject.org #inter-amc.kereval.com #nagios.ihe-europe.net #order-manager.ihe-europe.net #ovh1.ihe-europe.net #ovh2.ihe-europe.net #ovh3.ihe-europe.net #ovh4.ihe-europe.net #portal.ihe-europe.net #vm-server.ihe-europe.net #vm-server2.ihe-europe.net #vm-server3.ihe-europe.net #vm-server4.ihe-europe.net #testing.consorzioarsenal.it #gazelle.interopsante.org #testivalidointipalvelu.kanta.fi #validointipalvelu.kanta.fi #www.ihe-europe.net conformity-assessment-testing.ihe-europe.net ) for i in "${servers[@]}" do cecho -blue "=======================================" cecho -blue "Working on $i" cecho -blue "=======================================" #ssh gazelle@$i "sudo sed -i 's/disk_home/disk2/g' /etc/nagios/nrpe_local.cfg " ssh gazelle@$i "sudo sed -i -e '\$acommand[inodes1]=/usr/lib/nagios/plugins/check_disk_inodes -w 20 -c 10 -p /' /etc/nagios/nrpe_local.cfg " #ssh gazelle@$i "sudo sed -i -e '\$acommand[inodes2]=/usr/lib/nagios/plugins/check_disk_inodes -w 20 -c 10 -p /home' /etc/nagios/nrpe_local.cfg " # ssh gazelle@$i "sudo sed -i -e '\$acommand[inodes2]=/usr/lib/nagios/plugins/check_disk_inodes -w 20 -c 10 -p /var/lib/vz' /etc/nagios/nrpe_local.cfg " ssh gazelle@$i "sudo wget -O /usr/lib/nagios/plugins/check_disk_inodes https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=5892&cf_id=24 " ssh gazelle@$i "sudo chmod +x /usr/lib/nagios/plugins/check_disk_inodes" ssh gazelle@$i "sudo /etc/init.d/nagios-nrpe-server restart" done