Adding opensips3.X + version support (#338)

This commit is contained in:
SharadKumar97
2021-01-02 03:00:49 +01:00
committed by GitHub
parent 8e2013cc2d
commit 8f80309e76
2 changed files with 20 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
# Author: Sharad Kumar <[email protected]>
# 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
+1
View File
@@ -1,5 +1,6 @@
#!/bin/bash
# Author: Sharad Kumar <[email protected]>
# 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}')