sonata-nfv / tng-communications-pilot

5GTANGO Communications pilot repository
Apache License 2.0
0 stars 12 forks source link

Monitoring of processes with snmpd #29

Open antonroman opened 5 years ago

antonroman commented 5 years ago

In order to monitor the status of critical processes to define the availability of the service we have decided to use SNMP as it is already used to get the other relevant status variables used to scale-in and out the services. To monitor them it 's enough to include the following lines in /etc/snmp/snmpd.conf: proc 'pm2-God-Daemon' 1 1

For the specific case of pm2 which is the daemon which launches all the Node.js processes we need to define a environment variable to set the process name to pm2-God-Daemon (it is important not to include whitespaces as it is not supported by snmp): Environment=PM2_DAEMON_TITLE=pm2-God-Daemon

To check the status of the process it is necessary to check the value of this variable: $ snmpwalk -v 3 -l authPriv -u "quobis" -a sha -A "asterisk" -x aes -X "asterisk" "192.168.56.102" .1.3.6.1.4.1.2021.2.1.100.1 iso.3.6.1.4.1.2021.2.1.100.1 = INTEGER: 0

If the value is different from 0 the service is down.