Install

Remon consists of two python scripts monitor and monitor-server

monitor server is a management web application that communicates with monitors and handles actions. To install just unpack it anywhere. then edit the server.conf and specify ports.

<monitor-server server="localhost:7777" web-server="localhost:8888" ssl="false">
	<user name="admin" password="admin" ip="all" rights="all"/>
</monitor-server>

server port is used by monitors to connect to monitor-server. and web-server is used by monitor administrators. You can make web server serve pages using https by specifying ssl="true" but you must have PyOpenSSL installed to use this functionality.

You can block users by specifying from which ip addresses they can log into the system. You can specify multiple ip addresses using comma.

You can specify different rights for users using comma like: execute and log or all to have all rights enabled

When you have monitor server configured run it using run.sh script and log into the specified web server url

For each server you want to monitor you need to copy the monitor to it and configure monitor.conf

<monitor name="mymonitor1" server="localhost:7777">
  <application name="appname" mark="appmark">
    <log name="Log" file="./test.py"/>
    <cmd name="Start" execute="./test.py"/>
  </application>
</monitor>

Where server is monitor server that this monitor should connect to and name is just unique name of this monitor. For each application you want to monitor you must specify application name and mark where mark is used in (pgrep -f mark). (note each application can have multiple processes running so each pid returned by pgrep is used) Each application can have multiple commands and log files. Use cmd tag to specify command name and execute attribute to specify which command to execute (note commands are executed relative to monitor's working directory and using monitor's creditenials)

Inside execute you can use %pid or %pid1,%pid2 .. %pidN that during the execution will be replaced by actual process pid.

For example you can write something like this

<cmd "Stop" execute="kill %pid"/>
<cmd "Kill" execute="kill -9 %pid"/>

Use log tag to specify log files and file attribute to specify path to log file

For example to monitor apache server you can use this config

<application name="apache" mark="httpd">
    <cmd name="Start" execute="service httpd start"/>
    <cmd name="Stop" execute="service httpd stop"/>
    <log name="Access Log" file="/var/log/httpd/access_log"/>
    <log name="Error Log" file="/var/log/httpd/error_log"/>
</application>

Now when you have your monitor configured start it using run.sh script and log into monitor server to see it

You can have multiple monitor instances running on the same server, running under the same or different creditenials