-
Notifications
You must be signed in to change notification settings - Fork 1
/
gping
executable file
·93 lines (87 loc) · 3.47 KB
/
gping
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
#
# async ping of a list of IP and produce a status HTML page
#
# RJM - Sun 29 Jan 10:41:12 AEDT 2023
# Version: 1.0.0
# requires:
#
# python 2.7+
# package: gevent
cd /bogo/gping
# note: ./www is sym linked to /var/www/html/gping (aka http://syswatch.science.mq.edu.au/gping/)
#
# executed regularly from root crontab (note 'root' required for ICMP send permissions)
#
# * * * * * /bogo/gping/gping > /dev/null 2>&1
# * * * * * sleep 30; /bogo/gping/gping > /dev/null 2>&1
#
WEB=www
INCLUDE=$WEB/include.html
INDEX=$WEB/index.html
source ~bogo/conda-setup.sh
conda activate gping
cat vmware-addresses | # from PowerCLI (sitea, syd01, syd04, vmc)`
sed ' # '-' prefix for skipped (grey), '+' prefix for fault (pink), '!' non-pingable (blue)
/stmmgtprod3002/ s/^/!/; t; # windows f/w blocking ping
/sccmpwbi1001a/ s/^/!/; t; # windows f/w blocking ping
/^10\.20\.248\./ s/^/!/; t; # Kyndryl Applicances - not pingable from outside PA VPN connection
/^10\.20\.250\./ s/^/!/; t; # Kyndryl Applicances - not pingable from outside PA VPN connection
/^10\.42\.0\.0/ s/^/!/; t; # Kyndryl Applicances - not pingable from outside PA VPN connection
/^10\.42\.0\.1/ s/^/!/; t; # Kyndryl Applicances - not pingable from outside PA VPN connection
/^10\.26\.4\.33/ s/^/!/; t; # Kyndryl Applicances - not pingable from outside PA VPN connection
/^10\.10\.100\.6/ s/^/-/; t; # firewall logs
/^10\.10\.100\.6/ s/^/-/; t; # firewall logs
/^10\.10\.100\.7/ s/^/-/; t; # firewall logs
/^10\.10\.100\.26/ s/^/-/; t; # firewall logs
/^10\.10\.100\.129/ s/^/-/; t; # firewall logs
/^10\.111\./ s/^/-/; t; # survivor
/^10\.123\./ s/^/-/; t; # survivor
/^169\./ s/^/-/; t; # Network appliance VMs
/^172\./ s/^/-/; t; # Private addresses
/^192\./ s/^/-/; t; # Private addresses
/^198\./ s/^/-/; t; # Network appliance VMs
/pbx/ s/^/-/; t; # PABX Appliances - never pingable ...
/MQU-MODE2/ s/^/-/; t; # SYD01 NSX appliances
/MQUSYD01-DLR/ s/^/-/; t; # SYD01 NSX appliances
/abedtest/ s/^/-/; t; # Abed test machines
/tlm/ s/^/-/; t; # IaaS test machines
/twm/ s/^/-/; t; # IaaS test machines
/TLM/ s/^/-/; t; # IaaS test machines
/TWM/ s/^/-/; t; # IaaS test machines
/xmc-nac/ s/^/-/; t; # Extreme Networks applicances
/xmc-purview/ s/^/-/; t;
/dcaasprd2002a/ s/^/-/; t; # Snowflake
/dcaasuat2002/ s/^/-/; t;
/t1csynprd1002a/ s/^/-/; t; # MUH
/t1csynuat1002a/ s/^/-/; t; # MUH
/MSLWXV002-FOA1806VW1/ s/^/+/; t; # FAULT
/spamgtprd001/ s/^/+/; t; # FAULT
/dbmgtprd100/ s/^/+/; t; # FAULT
/gahwsuat2001/ s/^/+/; t; # FAULT
/gahwsdev2001/ s/^/+/; t; # FAULT
/gahasprd2001/ s/^/+/; t; # FAULT
' |
sed 's/.mqauth.uni.mq.edu.au//' |
sed 's/vcenter.sddc-54-253-2-26.vmwarevmc.com/vmc - sddc1/' |
sed 's/pam06itvctr001/campus-cluster/' |
python gping.py |
sort -n |
awk -F, '
BEGIN {
colour["True"] = "green";
colour["False"] = "red";
colour["Skipped"] = "grey";
colour["Fault"] = "pink";
colour["Kyndryl"] = "lightblue";
}
{
print "<div id=\"" $1 "\" " \
"class=\"indicator " colour[$2] "\">" \
"<span class=\"tooltiptext\">" $1 "<br>" $3 "<br>" $4"</span>" \
"</div>"
}
' > $INCLUDE.$$
chmod a+r $INCLUDE.$$
mv $INCLUDE.$$ $INCLUDE
touch $INDEX # make client browser think there has been a refresh ...