Monitors
From PortSensor Wiki
Monitors do the actual work of gathering and reporting sensor metrics for devices to the Server. The monitor profiles configured in the server provide each monitor with a login.
Contents |
Console Monitor
The console monitor can monitor ports or any combination of console commands and report the output as a sensor, allowing you to remotely monitor metrics like load, disk space, mail queues, logs or the availability of any port-based services (e.g. HTTP, SMTP, SSH).
To monitor most local metrics this should be installed on each server. However, for simpler needs, it's entirely possible to set up a single monitor instance to monitor the port-based services of several remote servers.
Installing on Unix-based Servers
- Create a PortSensor user account:
useradd portsensor cd ~portsensor
Download the Console Monitor:
wget "http://www.portsensor.com/files/PortSensorConsoleMonitor.zip" unzip PortSensorConsoleMonitor.zip cd psmonitor
- Check that the Java Runtime Environment (JRE) exists and is version 1.5 or higher:
java -version
- If necessary, download the JRE into the ~portsensor/psmonitor directory.
chmod 700 jre-xxx.bin ./jre-xxx.bin mv jre1.x.x_xx jre
- Run the monitor self-configuration:
jre/bin/java -jar psmonitor.jar --config
- Follow the prompts:
- Config File: config.xml
- PortSensor URL: http://yourdomain/portsensor/post
- Monitor ID: [from PortSensor Server]
- Monitor Password: [from PortSensor Server]
- Add Device ID: [from PortSensor Server]
- Device Hostname: [localhost, hostname or IP]
- Choose the ports you want to monitor.
- Repeat for as many devices as you want to observe from this monitor.
- (Optional) Create rules and advanced configuration
- Test your configuration:
jre/bin/java -jar psmonitor.jar config.xml --test
- Set up a cron or scheduled task for:
~portsensor/psmonitor/jre/bin/java -jar ~portsensor/psmonitor/psmonitor.jar ~portsensor/psmonitor/config.xml
- Check your server interface to verify updates are received: http://yoursite/portsensor/
