Oracle daily maintenancy-listener check

文章目录

  • 1.About check_mk metric:ORA_Listener_Check
  • 2.Solution
    • 2.1 check whether the listener process exists
    • 2.2 start listener

1.About check_mk metric:ORA_Listener_Check

This is a custom monitoring metric on check_mk platform,check whether oracle listener is normal.
the threshold is defined in /usr/lib/check_mk_oracle/MAIN/conf1/perf_{SID}_lsnrctl.json

[oracle@hrisdb_prod conf1]$ cat perf_IDHRISDB_lsnrctl.json 
{"target_info":[{
"perf_min":"0",
"chk_interval":5000,
"output_cmd":"echo",
"post_action":"",
"perf_crit":"1",
"chk_cmd":"sh run_lsnrctl.sh",
"perf_max":"0",
"chk_result_separator":";",
"perf_warn":"1",
"database":"IDHRISDB"
}]}

notice the two threshold value:“perf_warn”:“1”,“perf_crit”:“1” , which will trigger warning alarm or critical alarm if reach the threshold respectively.

2.Solution

2.1 check whether the listener process exists

[oracle@hrisdb_prod conf1]$ cat ../run_lsnrctl.sh 
#!/bin/sh
cd /tmp

if [ -s lsnr.exist ]
then
rm -f lsnr.exist
fi

ps -ef | grep LISTENER | grep -v grep > lsnr.exist

if [ -s lsnr.exist ]
then
 echo "ORA_Listener_Check;0;Listener on host is up;$VAR_TEIM" 
else 
 echo "ORA_Listener_Check;1;Listener on host is down;$VAR_TEIM" 
fi  

2.2 start listener

lsnrctl status    ---check listener status
lsnrctl start     ---start all listener

if can not yet start listener, maybe you nee do view the log that be located in $ORACLE_HOME/network/log/listener.log,which will help you find out more further issue

你可能感兴趣的:(Oracle,oracle,数据库)