Three Oracle db status need to be monitor ...
Three Oracle db status need to be monitor ...
Can NagiosXI monitor these three Oracle db status?
Our customer use PRTG to monitor these three status, and ask if their NagiosXI 2012 can monitor, too?
-----
[Total Sessions]
select count(*) from v$session;
-----
[Blocking Process]
SELECT count(*) FROM gv$session a, gv$instance b WHERE a.inst_id = b.inst_id AND a.blocking_session IS NOT NULL ORDER BY a.blocking_session;
-----
[Blocking Sessions]
select count(*) from Gv$session where blocking_session is not NULL order by blocking_session;
Our customer use PRTG to monitor these three status, and ask if their NagiosXI 2012 can monitor, too?
-----
[Total Sessions]
select count(*) from v$session;
-----
[Blocking Process]
SELECT count(*) FROM gv$session a, gv$instance b WHERE a.inst_id = b.inst_id AND a.blocking_session IS NOT NULL ORDER BY a.blocking_session;
-----
[Blocking Sessions]
select count(*) from Gv$session where blocking_session is not NULL order by blocking_session;
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Three Oracle db status need to be monitor ...
Provided these return a single integer, yes this is absolutely possible. The oracle query wizard should be able to walk you through this.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Three Oracle db status need to be monitor ...
In Oracle local host, can directly use command: select count(*) from v$session
But if use "oracle query wizard" to monitor, there will be error, see attachment error1.jpg and error2.jpg:
command 1:
check_xi_oraclequery!-connect 172.17.1.99:1521 --username system --password "password" --mode sql --name="select count(*) from v$session" --warning 10000 --critical 13000
command 2:
check_xi_oraclequery! --connect "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.1.99)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = mvf)))" --username system -- password " password" --mode sql --name="select count(*) from v$session" --warning 10000 --critical 13000
I wonder if anything wrong?
.
But if use "oracle query wizard" to monitor, there will be error, see attachment error1.jpg and error2.jpg:
command 1:
check_xi_oraclequery!-connect 172.17.1.99:1521 --username system --password "password" --mode sql --name="select count(*) from v$session" --warning 10000 --critical 13000
command 2:
check_xi_oraclequery! --connect "(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.17.1.99)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = mvf)))" --username system -- password " password" --mode sql --name="select count(*) from v$session" --warning 10000 --critical 13000
I wonder if anything wrong?
.
You do not have the required permissions to view the files attached to this post.
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Three Oracle db status need to be monitor ...
Based on the second error, it seems that your tns names file is not complete. This is something you should work with your oracle DBA on. As for the first error, it seems that the connection made, states that this table does not exist, is a current session only table that gets created?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: Three Oracle db status need to be monitor ...
I installed Oracle 11g (11.2.0.1) on a computer for testing, db name is test01, ip is 192.168.1.107
when using MyOra tools to connect Oracle, the command return successful, meaning that syntax is fine.
select count(*) from v$session where status = 'ACTIVE'
but when SSH to NagiosXI using check_oracle_health, it failed, the error message indicate Oracle install_driver failed. don't know what could be the problem?
by the way, the NagiosXI wizard-Oracle Query is based on check_oracle_health, but the syntax of check_oracle_health seems wrong :
./check_oracle_health --connect 192.168.1.107:1521 --username system --password Passw0rd --mode sql --name="select count(*) from v/$session where status = "active" " --warning 3000 --critical 5000
it seems should be :
./check_oracle_health --connect 192.168.1.107:1521/test01 --username system --password Passw0rd --mode sql --name="select count(*) from v$session where status = 'ACTIVE' " --warning 3000 --critical 5000
.
when using MyOra tools to connect Oracle, the command return successful, meaning that syntax is fine.
select count(*) from v$session where status = 'ACTIVE'
but when SSH to NagiosXI using check_oracle_health, it failed, the error message indicate Oracle install_driver failed. don't know what could be the problem?
by the way, the NagiosXI wizard-Oracle Query is based on check_oracle_health, but the syntax of check_oracle_health seems wrong :
./check_oracle_health --connect 192.168.1.107:1521 --username system --password Passw0rd --mode sql --name="select count(*) from v/$session where status = "active" " --warning 3000 --critical 5000
it seems should be :
./check_oracle_health --connect 192.168.1.107:1521/test01 --username system --password Passw0rd --mode sql --name="select count(*) from v$session where status = 'ACTIVE' " --warning 3000 --critical 5000
.
You do not have the required permissions to view the files attached to this post.
Re: Three Oracle db status need to be monitor ...
Our customer said they use PRTG and same command can output data, but NagiosXi didn't.
We use Oracle system account on NagiosXI script to collect data but no output.
I refer http://support.nagios.com/forum/viewtop ... 3&start=30 , but have no idea how to setup NagiosXI environment?!
We use Oracle system account on NagiosXI script to collect data but no output.
I refer http://support.nagios.com/forum/viewtop ... 3&start=30 , but have no idea how to setup NagiosXI environment?!
You do not have the required permissions to view the files attached to this post.
Re: Three Oracle db status need to be monitor ...
Try doubling your '$' in v$session:
Code: Select all
v$$sessionFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Three Oracle db status need to be monitor ...
still error!!abrist wrote:Try doubling your '$' in v$session:Code: Select all
v$$session
You do not have the required permissions to view the files attached to this post.
Re: Three Oracle db status need to be monitor ...
Alright. Try using the resource.cfg file. Edit
Add in a macro, we will use $USER9$ for this example.
Save out.
Now change your check to reference $USER9$:
Restart nagios and check it.
You may want to load the whole query from the resource.cfg file:
And then make the check:
Code: Select all
:
/usr/local/nagios/etc/resource.cfgCode: Select all
$USER9$=v$sessionNow change your check to reference $USER9$:
Code: Select all
./check_oracle_health --connect 192.168.1.107:1521/test01 --username system --password Passw0rd --mode sql --name="select count(*) from $USER9$ where status = 'ACTIVE' " --warning 3000 --critical 5000You may want to load the whole query from the resource.cfg file:
Code: Select all
$USER9$=sql --name="select count(*) from v$session where status = 'ACTIVE' "Code: Select all
./check_oracle_health --connect 192.168.1.107:1521/test01 --username system --password Passw0rd --mode $USER9$ --warning 3000 --critical 5000Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Three Oracle db status need to be monitor ...
abrist wrote:Alright. Try using the resource.cfg file. EditAdd in a macro, we will use $USER9$ for this example.Code: Select all
: /usr/local/nagios/etc/resource.cfgSave out.Code: Select all
$USER9$=v$session
Now change your check to reference $USER9$:still error!Code: Select all
./check_oracle_health --connect 192.168.1.107:1521/test01 --username system --password Passw0rd --mode sql --name="select count(*) from $USER9$ where status = 'ACTIVE' " --warning 3000 --critical 5000![]()
Restart nagios and check it.
You may want to load the whole query from the resource.cfg file:how to load that?Code: Select all
$USER9$=sql --name="select count(*) from v$session where status = 'ACTIVE' "![]()
And then make the check:still error!Code: Select all
./check_oracle_health --connect 192.168.1.107:1521/test01 --username system --password Passw0rd --mode $USER9$ --warning 3000 --critical 5000![]()
You do not have the required permissions to view the files attached to this post.