nagios db fluch and vacuum script help needed
Posted: Mon Aug 22, 2016 11:08 am
In my relentless pursuit of nagiosisness, I came across this article from waaaaayyyy back:
I am interested in making a script that does maintenance on my dbs. But when I run the commands :
i get:
this is on xi5 latest versions with postgress dbs. Any ideas on what I need to do to make it work?
thanks in advance!
Code: Select all
http://labs.nagios.com/2011/11/15/nagios-xi-benchmarking-experiments/Code: Select all
psql nagiosxi nagiosxi -c "vacuum;"
psql nagiosxi nagiosxi -c "vacuum analyze;"
psql nagiosxi nagiosxi -c "vacuum full;"Code: Select all
psql nagiosxi nagiosxi -c "vacuum;"
WARNING: skipping "pg_authid" --- only superuser can vacuum it
WARNING: skipping "pg_database" --- only superuser can vacuum it
WARNING: skipping "pg_tablespace" --- only superuser can vacuum it
WARNING: skipping "pg_pltemplate" --- only superuser can vacuum it
WARNING: skipping "pg_shdepend" --- only superuser can vacuum it
WARNING: skipping "pg_shdescription" --- only superuser can vacuum it
WARNING: skipping "pg_auth_members" --- only superuser can vacuum it
VACUUM
[root@LKENNAGIOST01 ~]# psql nagiosxi nagiosxi -c "vacuum analyze;"
WARNING: skipping "pg_authid" --- only superuser can vacuum it
WARNING: skipping "pg_database" --- only superuser can vacuum it
WARNING: skipping "pg_tablespace" --- only superuser can vacuum it
WARNING: skipping "pg_pltemplate" --- only superuser can vacuum it
WARNING: skipping "pg_shdepend" --- only superuser can vacuum it
WARNING: skipping "pg_shdescription" --- only superuser can vacuum it
WARNING: skipping "pg_auth_members" --- only superuser can vacuum it
VACUUM
[root@LKENNAGIOST01 ~]# psql nagiosxi nagiosxi -c "vacuum full;"
WARNING: skipping "pg_authid" --- only superuser can vacuum it
WARNING: skipping "pg_database" --- only superuser can vacuum it
WARNING: skipping "pg_tablespace" --- only superuser can vacuum it
WARNING: skipping "pg_pltemplate" --- only superuser can vacuum it
WARNING: skipping "pg_shdepend" --- only superuser can vacuum it
WARNING: skipping "pg_shdescription" --- only superuser can vacuum it
WARNING: skipping "pg_auth_members" --- only superuser can vacuum it
VACUUM
thanks in advance!