1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

Adding opensips3.X + version support (#338)

This commit is contained in:
SharadKumar97
2021-01-01 20:00:49 -06:00
committed by GitHub
parent 8e2013cc2d
commit 8f80309e76
2 changed files with 20 additions and 0 deletions

19
snmp/opensip3-stats.sh Normal file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# Author: Sharad Kumar <skumar@securevoip.io>
# This script is for OpenSIPS 3.X + version
total_memory=$(opensips-cli -x mi get_statistics total_size | awk '/shmem:total_size/ { gsub(/[",]/,""); print "Total Memory=" $2}')
used_memory=$(opensips-cli -x mi get_statistics real_used_size | awk '/shmem:real_used_size/ { gsub(/[",]/,""); print "Used Memory=" $2}')
free_memory=$(opensips-cli -x mi get_statistics free_size | awk '/shmem:free_size/ { gsub(/[",]/,""); print "Free Memory=" $2}')
load_average=$(ps -C opensips -o %cpu | awk '{sum += $1} END {print "Load Average=" sum}')
total_files=$(lsof -c opensips | wc -l)
echo $total_memory
echo $used_memory
echo $free_memory
echo $load_average
echo "Open files="$total_files
exit

View File

@@ -1,5 +1,6 @@
#!/bin/bash
# Author: Sharad Kumar <skumar@securevoip.io>
# This script is for OpenSIPS 2.X + version
total_memory=$(opensipsctl fifo get_statistics total_size | awk '{print "Total Memory=" $2}')
used_memory=$(opensipsctl fifo get_statistics real_used_size | awk '{print "Used Memory=" $2}')