Wednesday, May 22nd 2013, 12:15am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to Monitoring-Portal.
Although this is a german monitoring forum, please don't hesitate to post in English. Nearly everybody here understands you and will answer in English as well.
If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form to register here or read more information about the registration process. If you are already registered, please login here.

contact_name

Professional

Posts: 710

Gender: male

Location: DMZ

Number of monitoring servers: 2

Nagios Version: 3.2.x

Distributed monitoring: Ja

Redundant monitoring: Nein

Number of hosts: 1300

Number of services: 9100

OS: SLES10

Plugin Version: 1.4.x

NagVis Version: 1.4

NDO Version: 1.4

Other Addons: NagiosGrapher, Business Process AddOns, netMySLA

1

Tuesday, March 24th 2009, 1:31pm

check_oracle_health -- Fehlermeldungen bei --method=sqlplus

Hallo zusammen,

ich bin gerade dabei, check_oracle_health 1.6 auf eine Anzahl von Maschinen auszurollen. Alles SuSE Linux Enterprise Server 10 SP2 (aktueller Patchstand). Oracle Instantclient Basic und -sqlplus sind installiert, Umgebungsvariablen für den Benutzer "nagios" sind gesetzt, der sqlplus-Testaufruf

Source code

1
sqlplus <username>/<kennwort>@<sid>

... funktioniert.

Weiterhin funktionieren die Abfragen tnsping, redolog-switch-interval und connection-time. Die wichtigste tablespace-Überwachung jedoch nicht. :(

Beispiel:

Source code

1
nagios@xxx:~> /usr/lib/nagios/plugins/check_oracle_health --method=sqlplus --connect=xxx --user=xxx --password=xxx --mode=tablespace-usage

... wirft ein:

Source code

1
2
3
4
5
6
7
8
9
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/plugins/check_oracle_health line 4170.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/plugins/check_oracle_health line 4173.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/plugins/check_oracle_health line 4181.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/plugins/check_oracle_health line 4182.
Use of uninitialized value in concatenation (.) or string at /usr/lib/nagios/plugins/check_oracle_health line 4185.
Use of uninitialized value in numeric eq (==) at /usr/lib/nagios/plugins/check_oracle_health line 2670, <> line 7.
Use of uninitialized value in subtraction (-) at /usr/lib/nagios/plugins/check_oracle_health line 2671, <> line 7.
Use of uninitialized value in division (/) at /usr/lib/nagios/plugins/check_oracle_health line 2671, <> line 7.
Illegal division by zero at /usr/lib/nagios/plugins/check_oracle_health line 2671, <> line 7.


Auch mit abgeschaltetem Perl-strict Modus läuft es nicht ...

Was mache ich falsch?

lausser

Professional

Posts: 1,459

Gender: male

Location: München

Occupation: Informatiker

Number of monitoring servers: 1

Nagios Version: 3.2.0

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 2000

Number of services: 50000

OS: Linux/SLES11, CentOS5.5

Plugin Version: 1.4.14

NDO Version: 1.4b7

Other Addons: PNP,mod_gearman,OMD,coshsh

2

Tuesday, March 24th 2009, 2:59pm

Nanu, schon der zweite heute. Gab's einen Oracle-Patch?
Versuch bitte mal, ob die Statements noch funktionieren:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
            SELECT
                a.tablespace_name "Tablespace",
                b.status "Status",
                b.contents "Type",
                b.extent_management "Extent Mgmt",
                sum(a.bytes_free + a.bytes_used) bytes,   -- allocated
                d.maxbytes bytes_max,
                SUM(a.bytes_free + a.bytes_used - NVL(c.bytes_used, 0)) bytes_free
            FROM
                sys.v_$TEMP_SPACE_HEADER a,
                sys.dba_tablespaces b,
                sys.v_$Temp_extent_pool c,
                dba_temp_files d
            WHERE
                c.file_id(+)             = a.file_id
                and c.tablespace_name(+) = a.tablespace_name
                and d.file_id            = a.file_id
                and d.tablespace_name    = a.tablespace_name
                and b.tablespace_name    = a.tablespace_name
            GROUP BY
                a.tablespace_name,
                b.status,
                b.contents,
                b.extent_management,
                d.maxbytes
            ORDER BY
                1

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
            SELECT
                a.tablespace_name         "Tablespace",
                b.status                  "Status",
                b.contents                "Type",
                b.extent_management       "Extent Mgmt",
                a.bytes                   bytes,
                a.maxbytes                bytes_max,
                c.bytes_free + NVL(d.bytes_expired,0)             bytes_free
            FROM
              (
                -- belegter und maximal verfuegbarer platz pro datafile
                -- nach tablespacenamen zusammengefasst
                -- => bytes
                -- => maxbytes
                SELECT
                    a.tablespace_name,
                    SUM(a.bytes)          bytes,
                    SUM(DECODE(a.autoextensible, 'YES', a.maxbytes, 'NO', a.bytes)) maxbytes
                FROM
                    dba_data_files a
                GROUP BY
                    tablespace_name
              ) a,
              sys.dba_tablespaces b,
              (
                -- freier platz pro tablespace
                -- => bytes_free
                SELECT
                    a.tablespace_name,
                    SUM(a.bytes) bytes_free
                FROM
                    dba_free_space a
                GROUP BY
                    tablespace_name
              ) c,
              (
                -- freier platz durch expired extents
                -- speziell fuer undo tablespaces
                -- => bytes_expired
                SELECT
                    a.tablespace_name,
                    SUM(a.bytes) bytes_expired
                FROM
                    dba_undo_extents a
                WHERE
                    status = 'EXPIRED'
                GROUP BY
                    tablespace_name
              ) d
            WHERE
                a.tablespace_name = c.tablespace_name (+)
                AND a.tablespace_name = b.tablespace_name
                AND a.tablespace_name = d.tablespace_name (+)


Gerhard

contact_name

Professional

Posts: 710

Gender: male

Location: DMZ

Number of monitoring servers: 2

Nagios Version: 3.2.x

Distributed monitoring: Ja

Redundant monitoring: Nein

Number of hosts: 1300

Number of services: 9100

OS: SLES10

Plugin Version: 1.4.x

NagVis Version: 1.4

NDO Version: 1.4

Other Addons: NagiosGrapher, Business Process AddOns, netMySLA

3

Tuesday, March 24th 2009, 3:53pm

Die Abfragen funktionieren beide und liefern sinnvolle Werte... Auf einer anderen (neueren) Ora-DB ebenso mit der selben instant-client/sqlplus-Umgebung ebenso.

lausser

Professional

Posts: 1,459

Gender: male

Location: München

Occupation: Informatiker

Number of monitoring servers: 1

Nagios Version: 3.2.0

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 2000

Number of services: 50000

OS: Linux/SLES11, CentOS5.5

Plugin Version: 1.4.14

NDO Version: 1.4b7

Other Addons: PNP,mod_gearman,OMD,coshsh

4

Tuesday, March 24th 2009, 6:52pm

Da sind zwei Sachen faul. Die "uninitialized value in concatenation"-Meldungen kommen daher, daß ORACLE_HOME undefiniert ist. Mich wundert, daß damit überhaupt ein DB-Connect möglich ist. Der Rest kommt daher, daß diese SQL-Statements anscheinend keine sinnvollen Werte liefern.
Bitte bau folgendes in Zeile 2520 ein:

Source code

1
2
3
4
5
6
7
...
        $thisparams{type} = lc $type;
        $thisparams{extent_management} = lc $extentmgmt;
printf STDERR "%s\n", Data::Dumper::Dumper(\%thisparams);   # <------
        my $tablespace = DBD::Oracle::Server::Database::Tablespace->new(
            %thisparams);
...


Gerhard

contact_name

Professional

Posts: 710

Gender: male

Location: DMZ

Number of monitoring servers: 2

Nagios Version: 3.2.x

Distributed monitoring: Ja

Redundant monitoring: Nein

Number of hosts: 1300

Number of services: 9100

OS: SLES10

Plugin Version: 1.4.x

NagVis Version: 1.4

NDO Version: 1.4

Other Addons: NagiosGrapher, Business Process AddOns, netMySLA

5

Wednesday, March 25th 2009, 5:08pm

ORACLE_HOME ist jetzt instantclient-tauglich gesetzt, dadurch sind die "unitialized value in concatenation"s verschwunden, danke.

Ausgabe mit eingebautem printf (an der Stelle "[...]" gekürzt, die $VAR1 taucht sehr oft gleichsam auf):

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$VAR1 = {
          'bytes_max' => '2097152000',
          'bytes' => '251658200',
          'name2' => undef,
          'absolute' => undef,
          'status' => 'online',
          'statefilesdir' => '/var/tmp/check_oracle_health',
          'mode' => 'server::database::tablespace::usage',
          'lookback' => undef,
          'password' => 'xxx',
          'basis' => undef,
          'timeout' => 60,
          'user' => 'xxx',
          'racmode' => 0,
          'method' => 'sqlplus',
          'criticalrange' => undef,
          'connect' => 'host_dbsid'',
          'extent_management' => 'local',
          'warningrange' => undef,
          'datafile' => undef,
          'eyecandy' => undef,
          'name' => 'BKK_TABLE',
          'handle' => bless( {
                               'sid' => 'host_dbsid',
                               'mode' => 'server::database::tablespace::usage',
                               'sqlplus' => '/usr/lib/oracle/11.1/client64/bin/sqlplus -S xxx/xxx@host_dbsid < /tmp/server::database::tablespace::usage1VHFH.sql > /tmp/server::database::tablespace::usage0MPNU.out',                               'oraclehome' => '/usr/lib/oracle/11.1/client64',
                               'password' => 'xxx',
                               'loginstring' => 'traditional',
                               'sql_resultfile_handle' => \*{'File::Temp::$fh'},
                               'timeout' => 60,
                               'user' => 'xxx',
                               'connect' => 'host_dbsid'',
                               'sql_commandfile' => '/tmp/server::database::tablespace::usage1VHFH.sql',
                               'access' => 'sqlplus',
                               'tnsadmin' => '/etc',
                               'tac' => '1237995064.86978',
                               'sql_commandfile_handle' => \*{'File::Temp::$fh'},
                               'handle' => undef,
                               'sql_resultfile' => '/tmp/server::database::tablespace::usage0MPNU.out'
                             }, 'DBD::Oracle::Server::Connection::Sqlplus' ),
          'selectname' => undef,
          'regexp' => undef,
          'type' => 'permanent',
          'bytes_free' => '17825790',
          'units' => undef,
          'tablespace' => undef
        };

[...]
		

Use of uninitialized value in numeric eq (==) at /usr/lib/nagios/plugins/check_oracle_health line 2671, <> line 7.
Use of uninitialized value in subtraction (-) at /usr/lib/nagios/plugins/check_oracle_health line 2672, <> line 7.
Use of uninitialized value in division (/) at /usr/lib/nagios/plugins/check_oracle_health line 2672, <> line 7.
Illegal division by zero at /usr/lib/nagios/plugins/check_oracle_health line 2672, <> line 7.


Edit:
Ich habe jetzt auch mal zum Test DBI::DBD und DBD::Oracle installiert, um auszuschließen, dass es daran liegt. Keine Änderung des Verhaltens... Ich wollte aber eigentlich auch mit method=sqlplus den Installationsaufwand senken...

This post has been edited 2 times, last edit by "contact_name" (Mar 25th 2009, 6:18pm)


lausser

Professional

Posts: 1,459

Gender: male

Location: München

Occupation: Informatiker

Number of monitoring servers: 1

Nagios Version: 3.2.0

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 2000

Number of services: 50000

OS: Linux/SLES11, CentOS5.5

Plugin Version: 1.4.14

NDO Version: 1.4b7

Other Addons: PNP,mod_gearman,OMD,coshsh

6

Wednesday, March 25th 2009, 7:28pm

ORACLE_HOME ist jetzt instantclient-tauglich gesetzt, dadurch sind die "unitialized value in concatenation"s verschwunden, danke.

Ausgabe mit eingebautem printf (an der Stelle "[...]" gekürzt, die $VAR1 taucht sehr oft gleichsam auf):

Source code

1
2
3
4
5
6
7
8
9
10
11
$VAR1 = {
          'bytes_max' => '2097152000',
          'bytes' => '251658200',
          'bytes_free' => '17825790',
[...]
		

Use of uninitialized value in numeric eq (==) at /usr/lib/nagios/plugins/check_oracle_health line 2671, <> line 7.
Use of uninitialized value in subtraction (-) at /usr/lib/nagios/plugins/check_oracle_health line 2672, <> line 7.
Use of uninitialized value in division (/) at /usr/lib/nagios/plugins/check_oracle_health line 2672, <> line 7.
Illegal division by zero at /usr/lib/nagios/plugins/check_oracle_health line 2672, <> line 7.


In den fehlerhaften Zeilen steht:

Source code

1
2
3
    if ($self->{bytes_max} == 0) {
      $self->{percent_used} =
          ($self->{bytes} - $self->{bytes_free}) / $self->{bytes} * 100;

Also kann's das nicht sein. Ich hab's mit diesen Werten getestet und es kam kein Fehler.

Quoted

die $VAR1 taucht sehr oft gleichsam auf

Das hilft mir nichts. Entweder ich bekomme den gesamten Output oder ich kann nicht weiterhelfen.

Quoted

Die Abfragen funktionieren beide und liefern sinnvolle Werte

Offensichtlich nicht.
Bau in "sub new" ein "printf "%s\n", Data:: Dumper:: Dumper(\%params);" ein und geh mit --name <tablespace> die Tablespaces einzeln durch. Bei irgendeinem müssen undefinierte Werte auftauchen. Dann nochmal den Output der SQL-Statements prüfen.

Gerhard

contact_name

Professional

Posts: 710

Gender: male

Location: DMZ

Number of monitoring servers: 2

Nagios Version: 3.2.x

Distributed monitoring: Ja

Redundant monitoring: Nein

Number of hosts: 1300

Number of services: 9100

OS: SLES10

Plugin Version: 1.4.x

NagVis Version: 1.4

NDO Version: 1.4

Other Addons: NagiosGrapher, Business Process AddOns, netMySLA

7

Friday, March 27th 2009, 11:23am

Das hilft mir nichts. Entweder ich bekomme den gesamten Output oder ich kann nicht weiterhelfen.
Ist gemacht, siehe Anhang.
contact_name has attached the following file:
  • dump.txt (111.38 kB - 89 times downloaded - Last download: May 4th 2013, 9:07pm)

lausser

Professional

Posts: 1,459

Gender: male

Location: München

Occupation: Informatiker

Number of monitoring servers: 1

Nagios Version: 3.2.0

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 2000

Number of services: 50000

OS: Linux/SLES11, CentOS5.5

Plugin Version: 1.4.14

NDO Version: 1.4b7

Other Addons: PNP,mod_gearman,OMD,coshsh

8

Friday, March 27th 2009, 12:19pm

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$VAR1 = {
          'bytes_max' => undef,  #  <-------
          'bytes' => undef,          #  <------------
          'name2' => undef,
          'absolute' => undef,
          'status' => '',
          'statefilesdir' => '/var/tmp/check_oracle_health',
          'mode' => 'server::database::tablespace::usage',
          'lookback' => undef,
          'password' => 'xxx',
          'timeout' => 60,
          'basis' => undef,
          'user' => 'xxx',
          'racmode' => 0,
          'method' => 'sqlplus',
          'criticalrange' => undef,
          'connect' => 'xxx',
          'extent_management' => '',
          'datafile' => undef,
          'warningrange' => undef,
          'name' => 'xxx',

Der Tablespace "xxx" ist irgendwie anders. Ich habe gestern noch was reinprogrammiert, das offline Tablespaces abfängt (die haben auch solche Fehlermeldungen geworfen=.
Allerdings steht bei dir status => ''. Wenn du jetzt nochmal dieses SQL-Statement aufrufst, wie sieht die Zeile für Tablespace xxx aus?

Gerhard

lausser

Professional

Posts: 1,459

Gender: male

Location: München

Occupation: Informatiker

Number of monitoring servers: 1

Nagios Version: 3.2.0

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 2000

Number of services: 50000

OS: Linux/SLES11, CentOS5.5

Plugin Version: 1.4.14

NDO Version: 1.4b7

Other Addons: PNP,mod_gearman,OMD,coshsh

9

Friday, March 27th 2009, 3:58pm

Das neue Release ist jetzt online. Damit werden offline Tablespaces erkannt und es kommt ein Warning. Ich kann aber nicht sagen, ob dir das weiterhilft, dazu bräuchte ich die SQL-Ausgabe.

Gerhard

Source code

1
2
3
4
$  check_oracle_health  --mode tablespace-free --name TEST_TBS --units MB
OK - tbs TEST_TBS has 128.00MB free space left | 'tbs_test_tbs_free_pct'=17.98%;0.70:;0.28: 'tbs_test_tbs_free'=128.00MB;5.00:;2.00:;0;712.00
$  check_oracle_health  --mode tablespace-free --name TEST_TBS --units MB
WARNING - tbs TEST_TBS is offline | 'tbs_test_tbs_free_pct'=100.00%;0.00:;0.00: 'tbs_test_tbs_free'=0.00MB;5.00:;2.00:;0;0.00

contact_name

Professional

Posts: 710

Gender: male

Location: DMZ

Number of monitoring servers: 2

Nagios Version: 3.2.x

Distributed monitoring: Ja

Redundant monitoring: Nein

Number of hosts: 1300

Number of services: 9100

OS: SLES10

Plugin Version: 1.4.x

NagVis Version: 1.4

NDO Version: 1.4

Other Addons: NagiosGrapher, Business Process AddOns, netMySLA

10

Friday, March 27th 2009, 5:34pm

Funzt!! Klasse. :)

Einen kleinen Bug habe ich noch:

Source code

1
'tbs_46 zeilen ausgewahlt._usage_pct'=0.00%;90;98 'tbs_46 zeilen ausgewahlt._usage'=0MB;0;0;0;0 'tbs_46 zeilen ausgewahlt._alloc'=0MB;;;0;0


sqlplus:
select tablespace_name from dba_tablespaces;

Wenn man im sqlplus die tablespaces abfragt steht dann am Ende eben, wie viele Zeilen diese Abfrage erzeugt hat. Das ist dann nur kein Bestandteil des Ergebnisses. ;)

lausser

Professional

Posts: 1,459

Gender: male

Location: München

Occupation: Informatiker

Number of monitoring servers: 1

Nagios Version: 3.2.0

Distributed monitoring: Ja

Redundant monitoring: Ja

Number of hosts: 2000

Number of services: 50000

OS: Linux/SLES11, CentOS5.5

Plugin Version: 1.4.14

NDO Version: 1.4b7

Other Addons: PNP,mod_gearman,OMD,coshsh

11

Friday, March 27th 2009, 6:22pm


select tablespace_name from dba_tablespaces;

Wie sieht die Ausgabe genau aus?

Such nach

Source code

1
] } grep { ! /^\d+ rows selected/ }
und schreib in der nächsten Zeile

Source code

1
grep { ! /^\d+ [Zz]eilen ausgew / }

contact_name

Professional

Posts: 710

Gender: male

Location: DMZ

Number of monitoring servers: 2

Nagios Version: 3.2.x

Distributed monitoring: Ja

Redundant monitoring: Nein

Number of hosts: 1300

Number of services: 9100

OS: SLES10

Plugin Version: 1.4.x

NagVis Version: 1.4

NDO Version: 1.4

Other Addons: NagiosGrapher, Business Process AddOns, netMySLA

12

Monday, March 30th 2009, 5:31pm

Warum nicht generell die Ausgabe der Zeilenzählung unterdrücken`? Damit funktioniert es.

Siehe: http://www.oracle.com/technology/support…q101.html#A5512

Patch liegt an.
contact_name has attached the following file:

This post has been edited 1 times, last edit by "contact_name" (Mar 31st 2009, 1:34pm)