Changing Nagios xi IP address

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
User avatar
srrhd
Posts: 131
Joined: Thu May 19, 2011 6:15 am

Re: Changing Nagios xi IP address

Post by srrhd »

Here is the result :

Code: Select all

[root@mNagiosxi ~]# psql nagiosxi nagiosxi
Welcome to psql 8.1.23, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

nagiosxi=> vacuum;
WARNING:  skipping "pg_authid" --- only table or database owner can vacuum it
WARNING:  skipping "pg_tablespace" --- only table or database owner can vacuum it
WARNING:  skipping "pg_pltemplate" --- only table or database owner can vacuum it
WARNING:  skipping "pg_shdepend" --- only table or database owner can vacuum it
WARNING:  skipping "pg_auth_members" --- only table or database owner can vacuum it
WARNING:  skipping "pg_database" --- only table or database owner can vacuum it
ERROR:  invalid page header in block 60 of relation "xi_sysstat"
nagiosxi=> vacuum analyze;
WARNING:  skipping "pg_authid" --- only table or database owner can vacuum it
WARNING:  skipping "pg_tablespace" --- only table or database owner can vacuum it
WARNING:  skipping "pg_pltemplate" --- only table or database owner can vacuum it
WARNING:  skipping "pg_shdepend" --- only table or database owner can vacuum it
WARNING:  skipping "pg_auth_members" --- only table or database owner can vacuum it
WARNING:  skipping "pg_database" --- only table or database owner can vacuum it
ERROR:  invalid page header in block 60 of relation "xi_sysstat"
nagiosxi=> vacuum full;
WARNING:  skipping "pg_authid" --- only table or database owner can vacuum it
WARNING:  skipping "pg_tablespace" --- only table or database owner can vacuum it
WARNING:  skipping "pg_pltemplate" --- only table or database owner can vacuum it
WARNING:  skipping "pg_shdepend" --- only table or database owner can vacuum it
WARNING:  skipping "pg_auth_members" --- only table or database owner can vacuum it
WARNING:  skipping "pg_database" --- only table or database owner can vacuum it
ERROR:  invalid page header in block 60 of relation "xi_sysstat"
nagiosxi=> \q
[root@mNagiosxi cron]# cd /usr/local/nagiosxi/cron
[root@mNagiosxi cron]# rm -f ../var/dbmaint.lock
[root@mNagiosxi cron]# ./dbmaint.php
CREATING: /usr/local/nagiosxi/var/dbmaint.lock
CLEANING ndoutils TABLE 'commenthistory'...
SQL: DELETE FROM nagios_commenthistory WHERE entry_time < FROM_UNIXTIME(1301406327)
CLEANING ndoutils TABLE 'processevents'...
SQL: DELETE FROM nagios_processevents WHERE event_time < FROM_UNIXTIME(1301406327)
CLEANING ndoutils TABLE 'externalcommands'...
SQL: DELETE FROM nagios_externalcommands WHERE entry_time < FROM_UNIXTIME(1332337527)
CLEANING ndoutils TABLE 'logentries'...
SQL: DELETE FROM nagios_logentries WHERE logentry_time < FROM_UNIXTIME(1325166327)
CLEANING ndoutils TABLE 'notifications'...
SQL: DELETE FROM nagios_notifications WHERE start_time < FROM_UNIXTIME(1325166327)
CLEANING ndoutils TABLE 'contactnotifications'...
SQL: DELETE FROM nagios_contactnotifications WHERE start_time < FROM_UNIXTIME(1325166327)
CLEANING ndoutils TABLE 'contactnotificationmethods'...
SQL: DELETE FROM nagios_contactnotificationmethods WHERE start_time < FROM_UNIXTIME(1325166327)
CLEANING ndoutils TABLE 'statehistory'...
SQL: DELETE FROM nagios_statehistory WHERE state_time < FROM_UNIXTIME(1269870327)
CLEANING ndoutils TABLE 'timedevents'...
SQL: DELETE FROM nagios_timedevents WHERE event_time < FROM_UNIXTIME(1332942027)
CLEANING ndoutils TABLE 'systemcommands'...
SQL: DELETE FROM nagios_systemcommands WHERE start_time < FROM_UNIXTIME(1332942027)
CLEANING ndoutils TABLE 'servicechecks'...
SQL: DELETE FROM nagios_servicechecks WHERE start_time < FROM_UNIXTIME(1332942027)
CLEANING ndoutils TABLE 'hostchecks'...
SQL: DELETE FROM nagios_hostchecks WHERE start_time < FROM_UNIXTIME(1332942027)
CLEANING ndoutils TABLE 'eventhandlers'...
SQL: DELETE FROM nagios_eventhandlers WHERE start_time < FROM_UNIXTIME(1332942027)
LASTOPT:  1332941102
INTERVAL: 60
NOW:      1332942327
OPTTIME:  1332944702
CLEANING nagiosxi TABLE 'commands'...
SQL: DELETE FROM xi_commands WHERE processing_time < 1332913527::abstime::timestamp without time zone
CLEANING nagiosxi TABLE 'events'...
SQL: DELETE FROM xi_events WHERE processing_time < 1332913527::abstime::timestamp without time zone
SQL1: SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL
SQL2: DELETE FROM xi_meta WHERE meta_id IN (SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL)
CLEANING nagiosql TABLE 'logbook'...
SQL: DELETE FROM tbl_logbook WHERE time < FROM_UNIXTIME(1332913527)
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"Repair Complete: Removing Lock File
[root@mNagiosxi cron]#
The errors about the block 60 remain and the problem persist:

Code: Select all

[root@mNagiosxi cron]# tail -f /usr/local/nagiosxi/var/sysstat.log
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"
"xi_sysstat".tail: /usr/local/nagiosxi/var/sysstat.log: file truncated
DB BACKEND:
Array
(
    [last_checkin] => 2012-03-28 16:50:36
    [bytes_processed] => 170122577
    [entries_processed] => 607674
    [connect_time] => 2012-03-28 09:15:23
    [disconnect_time] => 0000-00-00 00:00:00
)
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"CMDLINE=/etc/init.d/nagios status
nagios (pid 9011) is running...
OUTPUT=nagios (pid 9011) is running...
RETURNCODE=0
CMDLINE=/etc/init.d/npcd status
NPCD running (pid 4355).
OUTPUT=NPCD running (pid 4355).
RETURNCODE=0
CMDLINE=/etc/init.d/ndo2db status
ndo2db (pid 4346) is running...
OUTPUT=ndo2db (pid 4346) is running...
RETURNCODE=0
DAEMONS:
Array
(
    [nagioscore] => Array
        (
            [daemon] => nagios
            [output] => nagios (pid 9011) is running...
            [return_code] => 0
            [status] => 0
        )

    [pnp] => Array
        (
            [daemon] => npcd
            [output] => NPCD running (pid 4355).
            [return_code] => 0
            [status] => 0
        )

    [ndoutils] => Array
        (
            [daemon] => ndo2db
            [output] => ndo2db (pid 4346) is running...
            [return_code] => 0
            [status] => 0
        )

)
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"HOSTCHECKPERF:
Array
(
    [min_latency] => 0.017
    [max_latency] => 3.332
    [avg_latency] => 0.94526223776224
    [min_execution_time] => 0.00342
    [max_execution_time] => 10.92532
    [avg_execution_time] => 1.589327972028
)
SERVICECHECKPERF:
Array
(
    [min_latency] => 0.004
    [max_latency] => 3.596
    [avg_latency] => 0.68230464480874
    [min_execution_time] => 0.00435
    [max_execution_time] => 10.95377
    [avg_execution_time] => 1.2851555327869
)
CORE STATS:
Array
(
    [hostcheckevents] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [servicecheckevents] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [timedevents] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [activehostchecks] => Array
        (
            [1min] => 81
            [5min] => 230
            [15min] => 371
        )

    [passivehostchecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [activeservicechecks] => Array
        (
            [1min] => 53
            [5min] => 731
            [15min] => 786
        )

    [passiveservicechecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [activehostcheckperf] => Array
        (
            [min_latency] => 0.017
            [max_latency] => 3.332
            [avg_latency] => 0.94526223776224
            [min_execution_time] => 0.00342
            [max_execution_time] => 10.92532
            [avg_execution_time] => 1.589327972028
        )

    [activeservicecheckperf] => Array
        (
            [min_latency] => 0.004
            [max_latency] => 3.596
            [avg_latency] => 0.68230464480874
            [min_execution_time] => 0.00435
            [max_execution_time] => 10.95377
            [avg_execution_time] => 1.2851555327869
        )

)
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"LOAD:
Array
(
    [load1] => 3.93
    [load5] => 4.40
    [load15] => 4.41
)
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"MEMORY:
Array
(
    [total] => 3034
    [used] => 2570
    [free] => 463
    [shared] => 0
    [buffers] => 263
    [cached] => 1417
)
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"SWAP:
Array
(
    [total] => 1023
    [used] => 0
    [free] => 1023
)
        SQL:    SQL Error [nagiosxi] :</b> ERROR:  invalid page header in block 60 of relation "xi_sysstat"
Configuration:
Nagios xi 2014R2.5
manually upgraded on 64bits CentOS 6
with nothing extra, no gnome, no proxy, no SSL
Add-ons: Hypermap, Minemap, Ping Action, Traceroute Action, Network Replay, Graph Explorer, Latest Alert
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Changing Nagios xi IP address

Post by scottwilkerson »

everything I have found regarding that error leads to a hardware problem (memory or disk) At this point I think it would be prudent to test both the ram and hardrives on the system.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
srrhd
Posts: 131
Joined: Thu May 19, 2011 6:15 am

Re: Changing Nagios xi IP address

Post by srrhd »

OK, finally a good news. I hope no jokes will appear.

I restarted the server in single mode to check its files system. Any block was corrupted.

After digging Google about "invalid page header in block of relation", i found a PostgreSQL variable that allow any postgre process to go on when it found an invalid page header. Then i retryied to clean the database following your commands, and it seems to have worked !

The steps were:
1.0 - Edit the PostgreSQL configuration:
vi /var/lib/pgsql/data/postgresql.conf
1.1 - Add the following line:
zero_damaged_pages = on
2 - Restart PostgreSQL:
service postgresql restart
3 - Clean the database:
psql nagiosxi nagiosxi
vacuum;
vacuum analyze;
vacuum full;
\q

cd /usr/local/nagiosxi/cron
rm -f ../var/dbmaint.lock
./dbmaint.php
4 - Remove the variable from the PostgreSQL configuration and restart the service again.

Below the prompt during the database cleaning process:

Code: Select all

[root@mNagiosxi ~]# psql nagiosxi nagiosxi
Welcome to psql 8.1.23, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit

nagiosxi=> vacuum;
WARNING:  skipping "pg_authid" --- only table or database owner can vacuum it
WARNING:  skipping "pg_tablespace" --- only table or database owner can vacuum it
WARNING:  skipping "pg_pltemplate" --- only table or database owner can vacuum it
WARNING:  skipping "pg_shdepend" --- only table or database owner can vacuum it
WARNING:  skipping "pg_auth_members" --- only table or database owner can vacuum it
WARNING:  skipping "pg_database" --- only table or database owner can vacuum it
WARNING:  relation "xi_sysstat" page 60 is uninitialized --- fixing
VACUUM
nagiosxi=> vacuum analyze;
WARNING:  skipping "pg_authid" --- only table or database owner can vacuum it
WARNING:  skipping "pg_tablespace" --- only table or database owner can vacuum it
WARNING:  skipping "pg_pltemplate" --- only table or database owner can vacuum it
WARNING:  skipping "pg_shdepend" --- only table or database owner can vacuum it
WARNING:  skipping "pg_auth_members" --- only table or database owner can vacuum it
WARNING:  skipping "pg_database" --- only table or database owner can vacuum it
VACUUM
nagiosxi=> vacuum full;
WARNING:  skipping "pg_authid" --- only table or database owner can vacuum it
WARNING:  skipping "pg_tablespace" --- only table or database owner can vacuum it
WARNING:  skipping "pg_pltemplate" --- only table or database owner can vacuum it
WARNING:  skipping "pg_shdepend" --- only table or database owner can vacuum it
WARNING:  skipping "pg_auth_members" --- only table or database owner can vacuum it
WARNING:  skipping "pg_database" --- only table or database owner can vacuum it
VACUUM
nagiosxi=> \q
[root@mNagiosxi ~]# cd /usr/local/nagiosxi/cron
[root@mNagiosxi cron]# rm -f ../var/dbmaint.lock
[root@mNagiosxi cron]# ./dbmaint.php
CREATING: /usr/local/nagiosxi/var/dbmaint.lock
CLEANING ndoutils TABLE 'commenthistory'...
SQL: DELETE FROM nagios_commenthistory WHERE entry_time < FROM_UNIXTIME(1301480470)
CLEANING ndoutils TABLE 'processevents'...
SQL: DELETE FROM nagios_processevents WHERE event_time < FROM_UNIXTIME(1301480470)
CLEANING ndoutils TABLE 'externalcommands'...
SQL: DELETE FROM nagios_externalcommands WHERE entry_time < FROM_UNIXTIME(1332411670)
CLEANING ndoutils TABLE 'logentries'...
SQL: DELETE FROM nagios_logentries WHERE logentry_time < FROM_UNIXTIME(1325240470)
CLEANING ndoutils TABLE 'notifications'...
SQL: DELETE FROM nagios_notifications WHERE start_time < FROM_UNIXTIME(1325240470)
CLEANING ndoutils TABLE 'contactnotifications'...
SQL: DELETE FROM nagios_contactnotifications WHERE start_time < FROM_UNIXTIME(1325240470)
CLEANING ndoutils TABLE 'contactnotificationmethods'...
SQL: DELETE FROM nagios_contactnotificationmethods WHERE start_time < FROM_UNIXTIME(1325240470)
CLEANING ndoutils TABLE 'statehistory'...
SQL: DELETE FROM nagios_statehistory WHERE state_time < FROM_UNIXTIME(1269944470)
CLEANING ndoutils TABLE 'timedevents'...
SQL: DELETE FROM nagios_timedevents WHERE event_time < FROM_UNIXTIME(1333016170)
CLEANING ndoutils TABLE 'systemcommands'...
SQL: DELETE FROM nagios_systemcommands WHERE start_time < FROM_UNIXTIME(1333016170)
CLEANING ndoutils TABLE 'servicechecks'...
SQL: DELETE FROM nagios_servicechecks WHERE start_time < FROM_UNIXTIME(1333016170)
CLEANING ndoutils TABLE 'hostchecks'...
SQL: DELETE FROM nagios_hostchecks WHERE start_time < FROM_UNIXTIME(1333016170)
CLEANING ndoutils TABLE 'eventhandlers'...
SQL: DELETE FROM nagios_eventhandlers WHERE start_time < FROM_UNIXTIME(1333016170)
LASTOPT:  1333014903
INTERVAL: 60
NOW:      1333016470
OPTTIME:  1333018503
CLEANING nagiosxi TABLE 'commands'...
SQL: DELETE FROM xi_commands WHERE processing_time < 1332987670::abstime::timestamp without time zone
CLEANING nagiosxi TABLE 'events'...
SQL: DELETE FROM xi_events WHERE processing_time < 1332987670::abstime::timestamp without time zone
SQL1: SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL
SQL2: DELETE FROM xi_meta WHERE meta_id IN (SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL)
CLEANING nagiosql TABLE 'logbook'...
SQL: DELETE FROM tbl_logbook WHERE time < FROM_UNIXTIME(1332987670)
Repair Complete: Removing Lock File
Now the server statistics are back and everything seems works properly. Thanks for your support.

Aurélien.
Configuration:
Nagios xi 2014R2.5
manually upgraded on 64bits CentOS 6
with nothing extra, no gnome, no proxy, no SSL
Add-ons: Hypermap, Minemap, Ping Action, Traceroute Action, Network Replay, Graph Explorer, Latest Alert
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Changing Nagios xi IP address

Post by scottwilkerson »

Glad to be able to lead you in the right direction, with Google's help ;)
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart