Monitoring SysStat Linux Melalui Web-Based GUI
System Monitoring
For some Linux administrators, the Linux server monitoring activity may be a definite need, because with the monitoring server, an optimal server where it has been fulfilled or not the resources owned by a server to support the distribution process.
Many of them still use the old way to collect their Linux system data, let’s call it the method of using sosreport in a Linux machine. Where the resulting data will be a lot and there is a need for the selection of data to be used, not to mention the creation of graph reports, so it is a little inconvenient and requires a long time for users.
Sysstat has several monitoring functions, including:
- sar = Collect and provide reports on the activities of the system that is running
- iostat = reports CPU usage and also Input and Output statistics from our disk
- mpstat = reports in full and statistics on our processors
- pidstat = report data obtained from application/process usage
- sadf = displays data obtained by sar in various formats
Here we will combine several existing resources to manage the sysstat
analysis data with additional graphics accessible through web-based, so it is expected that sysstat data/reporting
can run quickly and completely.
Install PHP
and Apache
1 2 | # vi /var/www/html/config.php # touch /var/www/html/data.json |
1 2 3 | define('SYSSTATDATAPATH','/var/log/sa'); define('JSONSTRUCTUREFILENAME','data.json'); define('NETWORKINTERFACELIST',serialize(array('eth0'))); |
Add a cronjob so that the sar generate analysis process can be done automatically
1 2 3 4 5 | # Run system activity accounting tool every 10 minutes */10 * * * * root /usr/lib/sa/sa1 1 1 # 0 * * * * root /usr/lib/sa/sa1 600 6 & # Generate a daily summary of process accounting at 23:55 55 23 * * * root /usr/lib/sa/sa2 -A |
I hope it has been a useful article.