使用 OPS$Nagios 帐户检查 oracle_health

使用 OPS$Nagios 帐户检查 oracle_health

我可以使用 OPS$ 帐户通过 sqlplus 登录我的数据库,但似乎无法让它与 nagios check_oracle_health 配合使用。我正在从命令行进行测试。

nagios@servername:/usr/local/nagios/libexec$ sqlplus /@TESTDB

SQL*Plus: Release 12.1.0.1.0 Production on Fri Jan 30 12:15:59 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

SQL> select user from dual;

USER
------------------------------
OPS$NAGIOS

使用用户名和密码登录确实可行,但我所在公司的政策不允许这样做。

nagios@servername:/usr/local/nagios/libexec$ ./check_oracle_health --connect=read/pw@TESTDB--mode=connection-time
OK - 0.22 seconds to connect as READ| connection_time=0.2174;1;5

nagios@omonopsview:/usr/local/nagios/libexec$ ./check_oracle_health --connect=/@TESTDB --mode=connection-time
CRITICAL - cannot connect to /***@TESTDB. ORA-12545: Connect failed because target host or object does not exist (DBD ERROR: OCIServerAttach)

nagios@servername:/usr/local/nagios/libexec$ ./check_oracle_health --connect=TESTDB --mode=sql --name="select user from dual;"
CRITICAL - cannot connect to TESTDB. ORA-12545: Connect failed because target host or object does not exist (DBD ERROR: OCIServerAttach)

nagios@servername:/usr/local/nagios/libexec$ ./check_oracle_health --connect=OPS\$nagios@TESTDB --mode=connection-time
CRITICAL - cannot connect to OPS$nagios@TESTDB. ORA-12545: Connect failed because target host or object does not exist (DBD ERROR: OCIServerAttach)

有人知道我做错了什么吗?

相关内容