mirror of
https://github.com/ThunixdotNet/monurbox.git
synced 2026-01-24 03:50:18 +00:00
Re-doing the work from earlier
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
export SITE=$1
|
||||
|
||||
ssh $SITE "bash -s" < ./plugins/check_proc mis > /dev/null
|
||||
ssh $SITE "bash -s" < ./plugins/check_proc bzfs > /dev/null
|
||||
if [ $? -ne "0" ]
|
||||
then
|
||||
echo -e $SITE"\tDOWN"
|
||||
10
checks/sshd_alt
Executable file
10
checks/sshd_alt
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
export SITE=$1
|
||||
|
||||
timeout 2 bash -c "</dev/tcp/${SITE}/2222" > /dev/null
|
||||
if [ $? -ne "0" ]
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
export SITE=$1
|
||||
|
||||
wget --quiet -O /dev/null $SITE
|
||||
wget --quiet -O /dev/null http://$SITE
|
||||
if [ $? -ne "0" ]
|
||||
then
|
||||
exit 1
|
||||
|
||||
10
checks/web_site_https
Executable file
10
checks/web_site_https
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
export SITE=$1
|
||||
|
||||
wget --quiet -O /dev/null https://$SITE
|
||||
if [ $? -ne "0" ]
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
10
checks/znc
Executable file
10
checks/znc
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
export SITE=$1
|
||||
|
||||
timeout 2 bash -c "</dev/tcp/${SITE}/1356" > /dev/null
|
||||
if [ $? -ne "0" ]
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
@@ -1,2 +0,0 @@
|
||||
telnet
|
||||
web_site
|
||||
2
hosts/root@thunix.cf
Normal file
2
hosts/root@thunix.cf
Normal file
@@ -0,0 +1,2 @@
|
||||
sshd
|
||||
BZFlag_server
|
||||
2
hosts/thunix.cf
Normal file
2
hosts/thunix.cf
Normal file
@@ -0,0 +1,2 @@
|
||||
web_site
|
||||
web_site_https
|
||||
@@ -1,2 +0,0 @@
|
||||
mis
|
||||
sshd
|
||||
10
monurbox
10
monurbox
@@ -2,6 +2,7 @@
|
||||
|
||||
export DEBUG=1
|
||||
export serv=$1
|
||||
export FILE=/var/www/thunix.cf/report
|
||||
|
||||
if [ ! -z $serv ]
|
||||
then
|
||||
@@ -12,7 +13,7 @@ done
|
||||
|
||||
else
|
||||
|
||||
echo -e "\n" >/tmp/report
|
||||
echo -e "\n" >$FILE
|
||||
echo -e "Host\tService\tStatus"
|
||||
for i in `ls ./hosts/`
|
||||
do for x in `cat ./hosts/$i`
|
||||
@@ -20,14 +21,15 @@ for i in `ls ./hosts/`
|
||||
./checks/$x $i > /dev/null
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo -e "$i\t$x\tFAILED"
|
||||
echo "$i,$x,FAILED" >> /tmp/report
|
||||
echo "$i,$x,FAILED" >> $FILE
|
||||
else
|
||||
echo -e "$i\t$x\tGOOD"
|
||||
echo "$i,$x,GOOD" >> /tmp/report
|
||||
echo "$i,$x,GOOD" >> $FILE
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
fi | column -t
|
||||
|
||||
sed -i '/^\s*$/d' /tmp/report
|
||||
sed -i '/^\s*$/d' $FILE
|
||||
sed -i '/^root//' $FILE
|
||||
|
||||
Reference in New Issue
Block a user