-
Notifications
You must be signed in to change notification settings - Fork 0
/
CLIENTBUILD.txt
62 lines (49 loc) · 2.26 KB
/
CLIENTBUILD.txt
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
BUILDING A CLIENT FOR MONITORING BY DEEZNETZ
Unpack the scripts somewhere, substitute your hostname for, `hostname`.
$ unzip deeznetz.zip
Create the client's work directory
$ sudo mkdir /usr/share/deez
Copy the script that answers the service there
$ sudo cp checkDeez.py /usr/share/deez/
Copy the script that crawls and creates hostname.xml of urls/ports to monitor
$ sudo cp deezcrawl.py /usr/share/deez/
Copy the stylesheet that is used to create the services up/down summary reports.
$ sudo cp packed.xsl /usr/share/deez/
Create the list of services on `hostname` to check
$ sudo ./deezcrawl.py
See if `hostname`.xml file created exists.
$ ls /usr/share/deez
`hostname`.xml checkDeez.py deezcrawl.py packed.py
Check to see if you need to edit it and it's well formed. Should have an entry for every port or URL to be monitored something like...
$ xmllint --format butthead.xml
<?xml version="1.0"?>
<host>
<service>
<protocol>hostmon</protocol>
<port status="UP">5355</port>
<type>tcp</type>
<check>2021-05-06T12:30:24</check>
</service>
</host>
Create the client service.
$ sudo ./deezyall.py
Check by executing:
$ ls /ib/systemd/system/deeznetz*
/lib/systemd/system/deeznetz@.service /lib/systemd/system/deeznetz.socket
Enable, start and check the client service created is listening.
$ sudo systemctl enable deeznetz.socket
$ sudo systemctl start deeznetz.socket
$ sudo systemctl status deeznetz.socket
Test the client service is working and all monitored services are up.
$ wget http://yourhostname:8142/OK
and look in file named OK in your current directory
or use a browser to the same url. Should get web page with a body of:
<?xml version="1.0"?><host name="hostname"><status>GREEN</status></host>
Server not hitting it?
$ sudo firewall-cmd --get-default-zone
$ sudo firewall-cmd --add-service deeznetz
$ sudo firewall-cmd --reload
$ sudo firewall-cmd --list-services
Should be working now! There is a header line at the bottom, line 183 in checkDeez.py:
sys.stdout.write("Access-Control-Allow-Origin: *\r\n");
the, '*', allows any host from across domains to connect, you should edit this to your domain, google, 'CORS', for information on cross-site scripting errors, especially if you are on a public network. Screen the port 8142 carefully on your firewalls.