Link to the Logmatic.io documentation
perfstats-to-syslog is a daemon which collects system performance statistics (CPU, Memory, Disk and Network) periodically and streams it in clean JSON format to a syslog agent It runs over Linux and Windows environments.
The following instructions is working only against Linux environments.
$ sudo apt-get install python-dev python-pip
$ sudo pip install psutil
Drop perfstats-to-syslog.cfg
and perfstats-to-syslog.py
into the /opt/perfstats-to-syslog
directory.
Drop perfstats-to-syslog.conf
into the /etc/init
directory.
Drop perfstats-to-syslog
into the /etc/init.d
directory.
Your syslog agent must listen UDP on port 514.
In /etc/rsyslog.conf
, you should ensure that the 2 following lines are uncommented:
$ModLoad imudp
$UDPServerRun 514
And restart the service.
In /etc/syslog-ng/syslog-ng.conf
:
- Add a UDP source:
source udp_src { udp(ip(0.0.0.0) port(514)); };
- Don't forget to wire it to a destination:
log { source(udp_src); destination(d_logmatic); };
Your configuration file should now be located at /opt/perfstats-to-syslog/perfstats-to-syslog.cfg
You should see something like:
[syslog]
host = 127.0.0.1
port = 514
pollingInSec = 5
[general]
paths = root:/
You can configure:
- the host and port of the syslog agent
- the polling period => 5 seconds by default
- paths of the disks you want to monitor
Ready?
To start the service with upstart:
$ sudo start perfstats-to-syslog
Or if you installed the service with init.d:
$ sudo /etc/init.d/perfstats-to-syslog start
As configured the service gets started at every reboot of your machine.