[UPDATE] - TP 05 - '#'
This commit is contained in:
parent
2ff5c979b5
commit
2f2a283f7e
@ -1,3 +0,0 @@
|
|||||||
10.10.10.3:1666#file#/tmp/test
|
|
||||||
10.10.10.3:1666#part#/home/isen|50|80
|
|
||||||
10.10.10.3:1666#process#sshd
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
10.10.10.4:1666#file#/tmp/test
|
|
||||||
10.10.10.4:1666#part#/home/isen|50|80
|
|
||||||
10.10.10.4:1666#process#sshd
|
|
||||||
4
monithor-client/etc/monithor-client/conf/sample.cfg
Normal file
4
monithor-client/etc/monithor-client/conf/sample.cfg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#IP:PORT#SONDE#ARGUMENT
|
||||||
|
#Ex :
|
||||||
|
#10.10.10.3:1666#part#/home/isen|50|80
|
||||||
|
|
||||||
@ -19,8 +19,8 @@ if [[ "$1" == "start" ]]
|
|||||||
[[ -f /tmp/endmonitor ]] && rm -f /tmp/endmonitor
|
[[ -f /tmp/endmonitor ]] && rm -f /tmp/endmonitor
|
||||||
rm /tmp/Monitor* /tmp/webmonithor &> /dev/null
|
rm /tmp/Monitor* /tmp/webmonithor &> /dev/null
|
||||||
|
|
||||||
TotalConfig=$(ls -1 /etc/monithor-client/conf/ | grep Card_.*\.cfg|wc -l)
|
TotalConfig=$(ls -1 /etc/monithor-client/conf/ | grep grep .*\.cfg| wc-l)
|
||||||
for Conf in $(ls -1 /etc/monithor-client/conf/ | grep Card_.*\.cfg)
|
for Conf in $(ls -1 /etc/monithor-client/conf/ | grep grep .*\.cfg)
|
||||||
do
|
do
|
||||||
screen -dmS ${Conf} bash /usr/local/bin/monithor-client.d/MoniThor ${Conf}
|
screen -dmS ${Conf} bash /usr/local/bin/monithor-client.d/MoniThor ${Conf}
|
||||||
done
|
done
|
||||||
|
|||||||
@ -23,7 +23,10 @@ while [[ ! -f /tmp/endmonitor ]]
|
|||||||
Arg=$(echo $DATA| cut -d"#" -f3)
|
Arg=$(echo $DATA| cut -d"#" -f3)
|
||||||
Res=$( echo -e "${Cmd}#${Arg}" | eval ${NcCmd} ${Remote} ${Port} 2> /dev/null)
|
Res=$( echo -e "${Cmd}#${Arg}" | eval ${NcCmd} ${Remote} ${Port} 2> /dev/null)
|
||||||
Ret=$?
|
Ret=$?
|
||||||
|
if [[ ! -z $(echo $DATA | grep ^"[0-9]*\.[0-9]*\.[0-9]*\.[0-9]*:[0-9]*#.*#" ) ]]
|
||||||
|
then
|
||||||
GenerateWeb "${Res:-5|No sonde $Cmd on serveur $Remote}" ${Cmd:-Nodata} ${Arg:-Noadata} ${Remote:-Nodata} /tmp/Monithor_${ConfFile}-tmp
|
GenerateWeb "${Res:-5|No sonde $Cmd on serveur $Remote}" ${Cmd:-Nodata} ${Arg:-Noadata} ${Remote:-Nodata} /tmp/Monithor_${ConfFile}-tmp
|
||||||
|
fi
|
||||||
done < /etc/monithor-client/conf/${ConfFile}
|
done < /etc/monithor-client/conf/${ConfFile}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user