Monitoring NGiNX
Metrics
The following metrics are submitted to Nixstats.
Requests per second
Accepts per second
Handled per second
Total requests
Active connections
Writing
Waiting
Reading
Dependencies
urllib2
nginx compiled with --with-httpstubstatusmodule parameter
Stub status page
To enable the nginx stub status page add the following codPopularMonitoring PHP-FPM
Metrics
The following metrics are submitted to Nixstats.
Accepted connections (per second, total)
Active processes
Total processes
Idle processes
Max active processes
Listen queue
Listen queue length
Max listen queue
Max children reached
Start time
Start since
Pool
Process manager
Slow requests
Dependencies
urllib2
jsonPopularCreating a custom plugin
The nixstats monitoring agent comes with a set of plugins to monitor your servers CPU, Memory, Disk, Network, Processes and a set of plugins for your services such as MongoDB, PHP-FPM, NGiNX, Apache2/httpd.
Besides these plugins it's possible to monitor other metrics on your server by building your own plugin. Plugins are written in Python 2 or Python 3. To find out the version of python your agent is running on run nixstatsagent info the path to the plugin directory should reveal the pythonPopularMonitoring HDD/SSD/NVMe Disk health
Using the diskstatus plugin you will be able to monitor the status of your hdd, ssd and/or nvme drives. This plugin requires the agent to be run under the root user.
This plugin requires nixstatsagent version 1.1.50 or higher. To upgrade run
pip install nixstatsagent --upgrade.
Run as root
The smartctl command needs to be run as the root user, therefor it's requiredSome readersMonitoring MySQL
Metrics
The following metrics are submitted to Nixstats.
maxusedconnections
openfiles
opentables
qcachefreeblocks
qcachefreememory
qcachetotalblocks
slaveopentemptables
threadscached
threadsconnected
threadsrunning
uptime
abortedclients
abortedconnects
binlogcachediskuse
binlogcacheuse
bytesreceived
bySome readersMonitoring Apache
Metrics
The following metrics are submitted to Nixstats.
IdleWorkers
ReadingWorkers
WritingWorkers
KeepaliveWorkers
DnsWorkers
ClosingWorkers
LoggingWorkers
FinishingWorkers
CleanupWorkers
requestspersecond
Total kBytes
Total Accesses
ServerUptimeSeconds
BusyWorkers
BytesPerReq
BytesPerSec
ConnsAsyncClosing
ConnsAsyncKeepSome readersMonitoring software RAID status (mdstat)
Mdadm is a Linux utility to manage and monitor software RAID. The mdadm monitoring plugin keeps track of failed disks in a RAID setup.
Mdadm metrics
Faulty
Active
Resync
Read only
Mdadm dependancies
This plugin needs the mdstat python plugin, you can install this by running pip install mdstat.
To fetch the status we also have to give this plugin sudo access, edit /etc/sudoers and add the following at the end of the file.Few readersMonitoring Docker
This module keeps track of docker instances on your machine. The module uses the "docker stats" command to retrieve the statistics.
Docker Metrics
Memory usage
Total memory
Network in
Network out
Disk write
Disk read
CPU usage
Docker container count
Installing the Docker Monitoring Plugin
The nixstats user needs sudo access to run docker stats. Open /etc/sudoers and append the following at the end of the file.
nixstats ALL=(ALL) NOPASSWD: /usr/bin/dockerFew readersMonitoring Virtual Machines (KVM, QEMU, Xen, Virtuozzo, VMWare ESX, LXC...)
This plugin keeps track of guest virtual machines on your server. The following metrics are monitored.
Virtual Machine metrics
Disk read (bytes)
Disk write (bytes)
Disk read (requests)
Disk write (requests)
Networking out (bytes)
Networking in (bytes)
CPU Usage
Memory Usage
Memory min guaranteed
Memory hard limit
Memory soft limit
Plugin dependancies
This plugin needs the libirt-python plugin, you can instalFew readersMonitoring Exim Mail Queue Size
This module keeps track of the total queue size when using exim. The module runs exim -bpc to retrieve the total mail queue size.
Exim Mail Queue Size Metrics
Total Queue Size
Installing the Exim Mail Queue Size Plugin
The nixstats user needs sudo access to run exim -bpc. Open /etc/sudoers and append the following at the end of the file.
nixstats ALL=(ALL) NOPASSWD: /usr/sbin/exim
This is considering exim is installed in /usr/sbin/exim.
Now open /etc/nixstatsFew readersMonitoring minecraft
This plugin monitors some metrics that are available on minecraft servers. It can keep track of multiple minecraft servers.
Minecraft Metrics
Active players
Max players
Install the Minecraft monitoring plugin
To install the minecraft plugin you just have to edit /etc/nixstats.ini. Add the following data.
The hosts value can accept multiple minecraft hosts, comma seperated. You can also just have a singleFew readersMonitoring CloudLinux
With the CloudLinux Module you'll be able to monitor individual users on your CloudLinux servers.
Installing the Cloudlinux PluginFew readersMonitoring Asterisk
Asterisk is a free and open source framework for building communications applications. This plugins allows you to monitor calls as well as incoming calls.
Asterisk Mail Queue Size Metrics
Calls
Incoming calls
Installing the Asterisk Plugin
The nixstats user needs sudo access to run sudo asterisk. Open /etc/sudoers and append the following at the end of the file.
nixstats ALL=(ALL) NOPASSWD: /usr/sbin/asterisk
This is considering exim is install in /usr/sbin/asterisFew readersMonitoring MongoDB
This plugin keeps track of your MongoDB instance.
MongoDB Metrics
asserts.msg
asserts.regular
asserts.rollovers
asserts.user
asserts.warning
connections.available
connections.current
connections.totalCreated
mem: bits
mem: mapped
mem: mappedWithJournal
mem: resident
mem: supported
mem: virtual
opLatencies.commands.latency
opLatencies.commands.ops
opLatencies.reads.latency
opLatencies.reads.ops
opLatencies.writes.latency
opLatencies.writes.opsFew readersMonitoring CPU Temperature
CPU Temperature is available currently only on Linux bare metal servers (not on virtual servers).
To test this plugin run sudo -u nixstats nixstatsagent test temp. This should return temperature for all available sensors on the server.
Enable the plugin by editing /etc/nixstats.ini add:
Now run service nixstatsagent restart to apply the changes.
(https://storage.crisp.chat/users/helpdesk/website/fe832dec61b99800/screenshot-2019-08-06-at-1350398744a.Few readersMonitoring Redis
Metrics
The metrics available from metrics can be found on the source of the plugin. You can enable/disable metrics by commenting them (prepend with ) out of the file.
Dependencies
redis pypi
If you're running python3 you can run pip3 install redis, if you're running the older python2 nixstatsagent you can run pip install redis.
You can find out the version by running nixstatsagentFew readers