Compare commits

..

5 Commits

Author SHA1 Message Date
guillaume
241ee2385f remote ip delete local ip comparaison 2024-03-30 11:44:35 +01:00
guillaume
6beee1e2ba update client conf + doc 2024-03-30 11:39:58 +01:00
guillaume
5d89ac6417 check local ip deletee 2024-03-30 11:31:35 +01:00
guillaume
c4801fa8dc remote ip 2024-03-30 11:24:49 +01:00
guillaume
44e406c80f doc 2024-03-30 10:43:30 +01:00
8 changed files with 11 additions and 23 deletions

View File

@ -9,9 +9,6 @@ date: 20220320
`/etc/init.d/monithor-c [start/stop]`
`/etc/init.d/monithor-c [start/stop]`
# DESCRIPTION
monithor-client(1) permet de surveiller votre système d'information
@ -32,7 +29,7 @@ le service peut être démarré et arrêté via system V
- Arrêt
`/etc/init.d/monithor-c start`
`/etc/init.d/monithor-c stop`
# CONFIGURATION SERVICE

View File

@ -30,13 +30,13 @@ le service peut être démarré et arrêté via system V
- Arrêt
`/etc/init.d/monithor-d start`
`/etc/init.d/monithor-d stop`
# CONFIGURATION SERVICE
- Le fichier responsable de la gestion IP/PORT est : service.cfg
`LocalIp=10.10.10.4`
`RemoteIp=10.10.10.4`
`LocalPort=1666`
@ -44,7 +44,7 @@ le service peut être démarré et arrêté via system V
`LocalPassword='Evil@MonitoR-666'`
* LocalIp : correspond à l'adresse IP de l'interface réseau en écoute
* RemoteIp : correspond à l'adresse IP de l'interface réseau en écoute du client de monitoring
* LocalPort : correspond au port de communication du client monithor

View File

@ -1,4 +1,3 @@
RemoteIp=10.10.10.3:1666
LocalPassword='Evil@MonitoR-666'
Crypted=no
Rotation=1

View File

@ -1,8 +0,0 @@
10.10.10.3:1666#file#/tmp/coucou
10.10.10.3:1666#file#/tmp/nop
10.10.10.3:1666#file#
10.10.10.3:1666#NotRealSondeName#reboot
10.10.10.4:1666#file#/tmp/coucou
10.10.10.4:1666#file#/tmp/nop
10.10.10.4:1666#file#
10.10.10.4:1666#NotRealSondeName#reboot

View File

@ -23,7 +23,7 @@ CheckAllEnd() {
echo '
<html>
<head>
<title>MoniThor on '${RemoteIp}' </title>
<title>MoniThor on '$(hostname)' </title>
<meta http-equiv="refresh" content="1" />
</head>
<title>MONITHOR</title>

View File

@ -8,7 +8,7 @@ python3 -m http.server ${1} &
echo '<html>
<head>
<title>MoniThor on '${RemoteIp}' </title>
<title>MoniThor on '$(hostname)' </title>
<meta http-equiv="refresh" content="1" />
</head>
<title>MONITHOR</title>

View File

@ -1,4 +1,4 @@
LocalIp=10.10.10.4
RemoteIp=10.10.10.4
LocalPort=1666
########
Crypted=no

View File

@ -8,7 +8,7 @@ source /etc/monithor-server/service.cfg
Exit () {
[[ "$1" == "root" ]] && echo "You have to be root ..."
[[ "$1" == "Config" ]] && echo "Ip configuration will failed"
#[[ "$1" == "Config" ]] && echo "Ip configuration will failed"
exit
}
@ -18,17 +18,17 @@ if [[ $(id -u) != "0" ]]
Exit root
fi
[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $LocalIp) ]] && Exit Config
#[[ -z $(ifconfig | grep inet | awk '{print $2}' | grep $RemoteIp) ]] && Exit Config
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort} " || NcCmd="nc -l ${LocalIp} ${LocalPort}"
[[ "${Crypted}" == "yes" ]] && NcCmd="cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort} " || NcCmd="nc -l ${RemoteIp} -p ${LocalPort}"
if [[ "${1}" == "start" ]]
then
while true
do
#coproc cryptcat -k ${LocalPassword} -l ${LocalIp} -p ${LocalPort}
#coproc cryptcat -k ${LocalPassword} -l ${RemoteIp} -p ${LocalPort}
coproc eval ${NcCmd}
while read -r cmd; do
logger "Running $cmd"