172 lines
3.9 KiB
Markdown
172 lines
3.9 KiB
Markdown
# MoniThor
|
|
|
|
## A propos
|
|
|
|
MoniThor is a simple monitoring tools in bash.
|
|
|
|
You can use it with netcat or cryptcat
|
|
|
|
You can see result on the client from a web page (self hosted python3 web server)
|
|
|
|
|
|
## Server Configuration
|
|
|
|
The configuration files for the server are :
|
|
|
|
|
|
### serivce.cfg
|
|
|
|
- /etc/monithor-server/service.cfg
|
|
|
|
```
|
|
LocalIp is the IP adresse to used on the server (can used 127.0.0.1)
|
|
LocalPort is the local port to used on the server
|
|
#########
|
|
Crypted can used netcrypt (yes) or netcat (no)
|
|
LocalPassword is to set if you used Crypted
|
|
|
|
```
|
|
|
|
### sonde.cfg
|
|
|
|
- /etc/monithor-server/sonde.cfg
|
|
|
|
```
|
|
SONDE#SCRIPT
|
|
```
|
|
|
|
SONDE is get by the server and it exec SCRIPT with ARG get from the client
|
|
|
|
SCRIPT are in /usr/local/bin/monithor-server.d/
|
|
|
|
Actual :
|
|
|
|
**file-present.sh** : check if a file (abosult path) is persent
|
|
|
|
**part-space.sh** : check the partition % (arg are : PATH|Min%|Max% ex : /home/isen|50|80)
|
|
|
|
**process-present.sh** : check if a process is running
|
|
|
|
### tree
|
|
|
|
- Tree for server
|
|
|
|
```
|
|
.
|
|
├── DEBIAN
|
|
│ └── control
|
|
├── etc
|
|
│ ├── init.d
|
|
│ │ └── monithor-d
|
|
│ └── monithor-server
|
|
│ ├── service.cfg
|
|
│ └── sonde.cfg
|
|
└── usr
|
|
└── local
|
|
└── bin
|
|
├── monithor-server
|
|
└── monithor-server.d
|
|
├── file-present.sh
|
|
└── FunctionOutput
|
|
|
|
8 directories, 7 files
|
|
|
|
```
|
|
|
|
### init.d System V
|
|
|
|
You can use monithor-server as a service
|
|
|
|
```
|
|
sudo /etc/init.d/monithor-d start/stop
|
|
```
|
|
|
|
|
|
## Client Configuration
|
|
|
|
The configuration files for the client are :
|
|
|
|
|
|
### serivce.cfg
|
|
|
|
- /etc/monithor-client/service.cfg
|
|
|
|
```
|
|
LocalPassword can be used if you chose Crypted=yes (process is slow)
|
|
Crypted=no (use netcat or cryptcat)
|
|
Rotation is the time between the ratation of all sonde
|
|
WebPort is the port to see the result on the web interfaces : http://127.0.0.1:PORT
|
|
TimeOut is the number of second before the interrogation failed
|
|
|
|
```
|
|
|
|
### sonde.cfg
|
|
|
|
- /etc/monithor-client/sonde.cfg
|
|
|
|
```
|
|
IP:PORT#SONDE#Arguemnent
|
|
```
|
|
|
|
```
|
|
+--------------+------------------+---------------------------------+----------------------+-----------------------------------+
|
|
| Client | server | server | server | server |
|
|
+-------------==>----------------==>-------------------------------==>--------------------==>----------------------------------+
|
|
| SONDE + ARG | Is SONDE exist ? | Get associated SCRIPT for SONDE | Exec SCRIPT With ARG | Push result with FORMAT [0-5]|TXT |
|
|
| are send to | | | | |
|
|
| IP port | | | | |
|
|
+--------------+------------------+---------------------------------+----------------------+-----------------------------------+
|
|
|
|
```
|
|
|
|
### tree
|
|
|
|
- Tree for client
|
|
|
|
```
|
|
.
|
|
├── DEBIAN
|
|
│ └── control
|
|
├── etc
|
|
│ ├── init.d
|
|
│ │ └── monithor-c
|
|
│ └── monithor-client
|
|
│ ├── conf
|
|
│ │ ├── Card_10.10.10.3-1666.cfg
|
|
│ │ └── Card_10.10.10.4-1666.cfg
|
|
│ ├── service.cfg
|
|
│ └── sonde.cfg
|
|
└── usr
|
|
└── local
|
|
└── bin
|
|
├── monithor-client
|
|
└── monithor-client.d
|
|
├── MoniThor
|
|
├── MoniThorFnct
|
|
└── MoniThorWebServer
|
|
|
|
9 directories, 10 files
|
|
|
|
```
|
|
### init.d System V
|
|
|
|
You can use monithor-client as a service
|
|
|
|
```
|
|
sudo /etc/init.d/monithor-c start/stop
|
|
```
|
|
|
|
|
|
|
|
### WEB
|
|
|
|
The client start a python3 sumple http server on localhost on `WebPort`
|
|
|
|
```
|
|
/usr/local/bin/monithor-client.d/MoniThorWebServer
|
|
```
|
|
|
|

|
|
|
|
|