Pertama itu ya pasti sedian linux base debian
Kedua app apache2 httpd atau ngix (a.k.a web server)<< install aja cara nya ada di google
Ketiga app python (beserta pip nya ) << install aja cara nya ada di google
Ke empat device yang akan di monitoring
Ke lima install library yang di butuhkan di script via pip
misall kalau ada warn mising library httplib2
yang tinggal install pip httplib2
seperti biasa kita bikin alias dulu di /etc/hosts
127.0.0.1 localhost
127.0.1.1 cisco
10.181.2.18 RADIO.001
192.168.2.254 Router-kantor
10.34.35.3 servera
10.34.35.5 serverb
10.34.35.4 serverc
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
di sini kita bakal monitoring servera,serverb,serverc dan, router serta radio
habis itu kita bikin file log nya
root@clonerxyz:~# echo a >> /var/www/html/log.txt
nah habis itu kita bikin list device alias nya al.ip usahain satu folder sama script python nya nanti
RADIO.001
Router-kantor
servera
serverb
serverc
kurang lebih isi nya gitu terus save
habis itu bikin script file python nya
import os
import httplib2
import datetime
import subprocess
http = httplib2.Http()
m = "echo "
n = ">> /var/www/html/log.txt"
k = " UP "
u = " -- "
h = " DOWN "
i = datetime.datetime.now()
a = open('/root/al.ip')
b = a.read()
c = b.split()
subprocess.call("rm /var/www/html/log.txt", shell=True)
for d in c:
e = os.system("ping -c 1 " + d)
if e == 256:
l = subprocess.call(m +str(i) +u +d +h +n , shell=True)
if e == 0 :
j = subprocess.call(m +str(i) +u +d +k +n , shell=True)
nah habis itu tinggal excute python nya
root@clonerxyz:~# python t2.py
nah habis itu kita lihat sudah ke update belum di web server nya
root@clonerxyz:~# w3m localhost/log.txt
2019-06-26 14:58:27.656049 -- RADIO.001 UP
2019-06-26 14:58:27.656049 -- Router-kantor UP
2019-06-26 14:58:27.656049 -- servera UP
2019-06-26 14:58:27.656049 -- serverb UP
2019-06-26 14:58:27.656049 -- serverc UP
nah kurang lebih nanti isi nya begitu nanti kalau device di ping timeoute tulisan UP nya berubah jadi down
tinggal di pasang cron kalau mau real time tiap menit detik atau jam, yang di crontab script python nya