Logo

GitLab

Sign in

cc / cti-shell

  • Back to Group
  • Project
  • Activity
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • cti-shell
  • freeswitch
  • check_logs.sh
  • [task #8040] 添加脚本
    8b97bcbd
    root authored
    2016-12-06 16:44:41 +0800  
    Browse Code ยป
check_logs.sh 348 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/bin/bash

#Define state
STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2

lastlog=`tail -1 /usr/local/freeswitch/log/freeswitch.log`
if [[ "$lastlog" =~ "took too long to complete or database not responding" ]];then
        msg="Warning"
        status=$STATE_WARNING
else 
	msg="OK"
        status=$STATE_OK
fi 

#Printing the results:
exit $status