In this article, I will give examples of monitoring Accel-ppp on Zabbix.
Let’s say Zabbix-agent is installed on a server with Accel-ppp.
See also my articles on Zabbix.
If the server with Accel-ppp is assigned the standard Linux template, then disable the “Network interface discovery” in the template or for the host, otherwise, for example, with a large number of ipoe interfaces and when Zabbix will constantly scan them, there will be performance problems.
Open the Zabbix-agent configuration file:
sudo nano /etc/zabbix/zabbix_agentd.conf
Here are some examples of getting various data (add these lines to the Zabbix-agent configuration file):
# active sessions
UserParameter=accelcmd_onlinesessions,accel-cmd -H192.168.2.1 -P password show stat | grep -A 3 ^ipoe: | grep "active"| tr -d " "| cut -f2 -d ":"
# starting sessions
UserParameter=accelcmd_startsessions,accel-cmd -H192.168.2.1 -P password show stat | grep -A 3 ^ipoe: | grep "starting"| tr -d " "| cut -f2 -d ":"
# auth lost
UserParameter=accelcmd_authlost,accel-cmd -H192.168.2.1 -P password show stat | grep -A 12 ^radius | grep "auth lost"| tr -d " "| cut -f2 -d ":" | cut -f1 -d "/"
# interim lost
UserParameter=accelcmd_interimlost,accel-cmd -H192.168.2.1 -P password show stat | grep -A 12 ^radius | grep "interim lost"| tr -d " "| cut -f2 -d ":" | cut -f1 -d "/"
# acct lost
UserParameter=accelcmd_acctlost,accel-cmd -H192.168.2.1 -P password show stat | grep -A 12 ^radius | grep "acct lost"| tr -d " "| cut -f2 -d ":" | cut -f1 -d "/"
Now create a template, for example with the name “Accel-ppp-template” and add data elements to it, I will give an example of one:
Name: accelcmd_onlinesessions
Type: Zabbix-agent
Key: accelcmd_onlinesessions
Information Type: Numeric (positive integer)
Unit of measurement: %
Update Interval (in seconds): 300
For data elements whose counter is growing, for example accelcmd_acctlost, we must indicate “Preprocessing: simple change”.
Create a graph for this data element, as well as a trigger, for example:
Name: Sessions <1000 on Accel-cmd show stat
Expression: {Accel-ppp-template:accelcmd_onlinesessions.last(0)}<1000
Name: accelcmd_acctlost > 100
Expression: {Accel-ppp-template:accelcmd_acctlost.last(0)}>100
You can also count the routes in which the word ipoe, ppp, etc. occurs, for example:
UserParameter=ip_route_grep_ipoe,ip route | grep ipoe | wc -l
You can calculate the number of running accel-ppp processes (extra data may get in, for example, if accel-ppp is launched via gdb, the number 2 will be displayed):
UserParameter=ps_accel-ppp,ps ax | grep "/usr/local/sbin/accel-pppd" | egrep -v grep | wc -l
I think it would be better to read processes through the Zabbix agent key of the proc.num, for example:
Name: proc.num accel-pppd
Type: Zabbix Agent
Key: proc.num[accel-pppd]
And also add a trigger that fires if the value is 0:
Expression: {Accel-ppp-template:proc.num[accel-pppd].last(0)}=0
After editing the configuration file, restart Zabbix-agent to apply the changes:
sudo service zabbix-agent restart
Similarly, you can monitor the number of connections on ports, the number of IP addresses in ipset, and the number of VLANs created:
UserParameter=count_vlan,ip a | grep ': vlan' | wc -l
UserParameter=count_ip_in_ipset_denyip,ipset list denyip | /bin/grep '\([[:digit:]]\{1,3\}\.\)\{3\}[[:digit:]]\{1,3\}' | /usr/bin/wc -l
UserParameter=count_active_connections_all,netstat -an | wc -l
UserParameter=count_active_connections_bgp,netstat -na | grep :179 | wc -l
UserParameter=count_active_connections_dhcp,netstat -na | grep :67 | wc -l
UserParameter=count_active_connections_cli_2000,netstat -na | grep :2000 | wc -l
UserParameter=count_active_connections_cmd_2001,netstat -na | grep :2001 | wc -l
UserParameter=count_active_connections_dae_3799,netstat -na | grep :3799 | wc -l
Read the number of errors in the logs, for example Quagga and notify if errors appear (for large logs I do not recommend using it):
UserParameter=count_error_in_bgpd_log,cat /var/log/quagga/bgpd.log |grep error |wc -l
See my other articles:
On the topic of Accel-ppp
On the topic of Zabbix
Monitoring current RX and TX network interface buffers in Zabbix
Monitoring nf_conntrack in Zabbix
interesting, I will test