Upgrade error backing up Postgre upgrade to version 5.3.4"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

Re: Upgrade error backing up Postgre upgrade to version 5.3.

Post by valmberg »

Ran that command on all prior tables, but still getting the same error message:

Code: Select all

[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_auditlog TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_commands TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_events TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_eventqueue TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_incidents TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_meta TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_options TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_sysstat TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_usermeta TO nagiosxi;'
GRANT
[root@nagios ~]# psql -d nagiosxi -U postgres -c 'GRANT ALL PRIVILEGES ON TABLE xi_users TO nagiosxi;'
GRANT

Code: Select all

Backing up PostgresQL databases...
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR:  permission denied for relation xi_eventqueue_eventqueue_id_seq
pg_dump: The command was: SELECT sequence_name, start_value, last_value, increment_by, CASE WHEN increment_by > 0 AND max_value = 9223372036854775807 THEN NULL      WHEN increment_by < 0 AND max_value = -1 THEN NULL      ELSE max_value END AS max_value, CASE WHEN increment_by > 0 AND min_value = 1 THEN NULL      WHEN increment_by < 0 AND min_value = -9223372036854775807 THEN NULL      ELSE min_value END AS min_value, cache_value, is_cycled, is_called from xi_eventqueue_eventqueue_id_seq
Error backing up PostgresQL database 'nagiosxi' !
Last edited by avandemore on Fri Dec 16, 2016 11:35 am, edited 1 time in total.
Reason: Please use code tags for output.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Upgrade error backing up Postgre upgrade to version 5.3.

Post by avandemore »

Please post the output of this:

Code: Select all

psql -d nagiosxi -U postgres -c '\d'
Please use code tags when pasting in your output.
Previous Nagios employee
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

Re: Upgrade error backing up Postgre upgrade to version 5.3.

Post by valmberg »

Code: Select all

# psql -d nagiosxi -U postgres -c '\d'
                       List of relations
 Schema |              Name               |   Type   |  Owner
--------+---------------------------------+----------+----------
 public | if_command_id_seq               | sequence | nagiosxi
 public | if_meta_id_seq                  | sequence | nagiosxi
 public | if_option_id_seq                | sequence | nagiosxi
 public | if_sysstat_id_seq               | sequence | nagiosxi
 public | if_user_id_seq                  | sequence | nagiosxi
 public | if_usermeta_id_seq              | sequence | nagiosxi
 public | xi_auditlog                     | table    | nagiosxi
 public | xi_auditlog_auditlog_id_seq     | sequence | nagiosxi
 public | xi_commands                     | table    | nagiosxi
 public | xi_commands_command_id_seq      | sequence | nagiosxi
 public | xi_eventqueue                   | table    | postgres
 public | xi_eventqueue_eventqueue_id_seq | sequence | postgres
 public | xi_events                       | table    | nagiosxi
 public | xi_events_event_id_seq          | sequence | nagiosxi
 public | xi_incidents                    | table    | nagiosxi
 public | xi_incidents_id_seq             | sequence | nagiosxi
 public | xi_meta                         | table    | nagiosxi
 public | xi_meta_meta_id_seq             | sequence | nagiosxi
 public | xi_options                      | table    | nagiosxi
 public | xi_options_option_id_seq        | sequence | nagiosxi
 public | xi_sysstat                      | table    | nagiosxi
 public | xi_sysstat_sysstat_id_seq       | sequence | nagiosxi
 public | xi_usermeta                     | table    | nagiosxi
 public | xi_usermeta_usermeta_id_seq     | sequence | nagiosxi
 public | xi_users                        | table    | nagiosxi
 public | xi_users_user_id_seq            | sequence | nagiosxi
(26 rows)
Please use code tags for output.
Last edited by avandemore on Fri Dec 16, 2016 12:14 pm, edited 1 time in total.
Reason: Please use code tags for output.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Upgrade error backing up Postgre upgrade to version 5.3.

Post by avandemore »

Please try this:

Code: Select all

psql -d nagiosxi -U postgres -qAt -c "SELECT 'GRANT SELECT, USAGE, UPDATE ON ' || relname || ' TO nagiosxi;' FROM pg_statio_all_sequences WHERE schemaname = 'public'" | psql -d nagiosxi -U postgres
Previous Nagios employee
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

Re: Upgrade error backing up Postgre upgrade to version 5.3.

Post by valmberg »

That worked. Thanks for all your help.

I have just one more issue that presented itself recently. Nagios isn't sending out email alerts. Should I create a new incident?

When I try to get a service (for example) to send a custom message, this is what appears in the log.

# tail -f /usr/local/nagios/var/nagios.log
[1481911077] wproc: NOTIFY job 136 from worker Core Worker 21369 is a non-check helper but exited with return code 255
[1481911077] wproc: host=Cenvapprd33; service=CPU Usage; contact=harrisj
[1481911077] wproc: early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1481911077] wproc: stderr line 01: No entry for terminal type "unknown";
[1481911077] wproc: stderr line 02: using dumb terminal settings.
[1481911077] wproc: NOTIFY job 135 from worker Core Worker 21367 is a non-check helper but exited with return code 255
[1481911077] wproc: host=Cenvapprd33; service=CPU Usage; contact=mosesj
[1481911077] wproc: early_timeout=0; exited_ok=1; wait_status=65280; error_code=0;
[1481911077] wproc: stderr line 01: No entry for terminal type "unknown";
[1481911077] wproc: stderr line 02: using dumb terminal settings.


The message "no entry for terminal type "unknown"" is the same as what appears in the upgrade log


Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
Fixing php-mcrypt bug...
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
No entry for terminal type "unknown";
using dumb terminal settings.

Nagios XI Upgrade Complete!
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Upgrade error backing up Postgre upgrade to version 5.3.

Post by avandemore »

Yes, please create a new thread or ticket if the information if this link does not help:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf

Are we okay to mark as resolved then?
Previous Nagios employee
valmberg
Posts: 49
Joined: Fri May 16, 2014 9:43 pm

Re: Upgrade error backing up Postgre upgrade to version 5.3.

Post by valmberg »

will do. you can close this one now. Thanks!
Locked