Database
host all xormon monitoring machine IP/hostname md5Running this command on your DB can help you locate pg_hba.conf
SHOW hba_file;After you complete this step restart the PostgresSQL service
$ rpm -q perl-DBI perl-DBD-Pg perl-DBI-1.627-4.el7.x86_64 perl-DBD-Pg-2.19.3-4.el7.x86_64
# yum install perl-DBD-Pg
# apt-get install libdbd-pg-perl
CREATE ROLE xormon WITH PASSWORD 'your_passw0rd' LOGIN; GRANT SELECT ON TABLE pg_stat_bgwriter TO xormon; GRANT SELECT ON TABLE pg_stat_database TO xormon; GRANT SELECT ON TABLE pg_stat_activity TO xormon; GRANT SELECT ON TABLE pg_locks TO xormon; GRANT SELECT ON TABLE pg_cursors TO xormon; GRANT SELECT ON TABLE pg_stat_progress_vacuum TO xormon; GRANT SELECT ON TABLE pg_stat_replication TO xormon; GRANT SELECT ON TABLE pg_stat_wal_receiver TO xormon;
yum -y install libaio.x86_64
apt-get -y install libaio1
dnf install libnsl.x86_64
# umask 022 # mkdir /opt/oracle # cd /opt/oracle # unzip /<download_dir>/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip # unzip /<download_dir>/instantclient-sqlplus-linux.x64-19.6.0.0.0dbru.zipZIP files will be unpacked into /opt/oracle/instantclient_<version>
# echo "/opt/oracle/instantclient_<version>" > /etc/ld.so.conf.d/oracle-instantclient.conf # ldconfig
wget https://download.oracle.com/otn_software/linux/instantclient/19600/oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm wget https://download.oracle.com/otn_software/linux/instantclient/19600/oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm
yum install oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm
apt-get update apt-get -y install alien alien --to-deb --scripts oracle-instantclient19.6-basic-19.6.0.0.0-1.x86_64.rpm alien --to-deb --scripts oracle-instantclient19.6-sqlplus-19.6.0.0.0-1.x86_64.rpm apt-get install -y libaio1 # Oracle client prerequisite apt-get install -y ./oracle-instantclient19.6-basic_19.6.0.0.0-2_amd64.deb apt-get install -y ./oracle-instantclient19.6-sqlplus_19.6.0.0.0-2_amd64.deb apt list --installed| grep orac oracle-instantclient19.6-basic/now 19.6.0.0.0-2 amd64 [installed,local] oracle-instantclient19.6-sqlplus/now 19.6.0.0.0-2 amd64 [installed,local] ls -l /usr/lib/oracle/19.6/client64/bin/sqlplus -rwxr-xr-x 1 root root 24472 Dec 17 2019 /usr/lib/oracle/19.6/client64/bin/sqlplus
$ sqlplus sys"/as sysdba" create user xormon_check identified by "<password>" default tablespace USERS temporary tablespace TEMP; grant create session to xormon_check; grant select on sys.v_$instance_ping to xormon_check; grant select on sys.v_$resource_limit to xormon_check; grant select on sys.gv_$resource_limit to xormon_check; grant select on sys.v_$sysmetric_summary to xormon_check; grant select on sys.gv_$sysmetric_summary to xormon_check; grant select on sys.v_$sysmetric_history to xormon_check; grant select on sys.gv_$sysmetric_history to xormon_check; grant select on sys.v_$datafile to xormon_check; grant select on sys.gv_$datafile to xormon_check; grant select on sys.v_$filestat to xormon_check; grant select on sys.gv_$filestat to xormon_check; grant select on sys.v_$instance to xormon_check; grant select on sys.gv_$instance to xormon_check; grant select on sys.v_$database to xormon_check; grant select on sys.gv_$database to xormon_check; grant select on sys.v_$osstat to xormon_check; grant select on sys.gv_$osstat to xormon_check; grant select on sys.v_$session to xormon_check; grant select on sys.gv_$session to xormon_check; grant select on sys.v_$sgainfo to xormon_check; grant select on sys.gv_$sgainfo to xormon_check; grant select on sys.v_$containers to xormon_check; grant select on sys.gv_$containers to xormon_check; grant select on sys.v_$pgastat to xormon_check; grant select on sys.gv_$pgastat to xormon_check; grant select on sys.v_$system_wait_class to xormon_check; grant select on sys.gv_$system_wait_class to xormon_check; grant select on sys.v_$system_event to xormon_check; grant select on sys.gv_$system_event to xormon_check; grant select on sys.v_$cluster_interconnects to xormon_check; grant select on sys.gv_$cluster_interconnects to xormon_check; grant select on sys.v_$sysstat to xormon_check; grant select on sys.gv_$sysstat to xormon_check; grant select on sys.v_$service_stats to xormon_check; grant select on sys.gv_$service_stats to xormon_check; grant select on sys.v_$event_histogram to xormon_check; grant select on sys.gv_$event_histogram to xormon_check; grant select on dba_free_space to xormon_check; grant select on dba_temp_free_space to xormon_check; grant select on dba_data_files to xormon_check; grant select on dba_registry to xormon_check; grant select on dba_temp_files to xormon_check; grant select on sys.registry$history to xormon_check; grant select on sys.REGISTRY$SQLPATCH to xormon_check; grant select on sys.v_$recovery_file_dest to xormon_check; grant select on sys.v_$log to xormon_check; grant select on sys.v_$controlfile to xormon_check; grant select on dba_alert_history_detail to xormon_check; grant select on sys.v_$logfile to xormon_check; exit;
$ sqlplus sys"/as sysdba" create user xormon_check identified by "<password>" default tablespace USERS temporary tablespace TEMP CONTAINER = ALL; grant create session to xormon_check CONTAINER = ALL; grant SET CONTAINER to xormon_check CONTAINER = ALL; grant select on sys.v_$instance_ping to xormon_check CONTAINER = ALL; grant select on sys.v_$resource_limit to xormon_check CONTAINER = ALL; grant select on sys.gv_$resource_limit to xormon_check CONTAINER = ALL; grant select on sys.v_$sysmetric_summary to xormon_check CONTAINER = ALL; grant select on sys.gv_$sysmetric_summary to xormon_check CONTAINER = ALL; grant select on sys.v_$sysmetric_history to xormon_check CONTAINER = ALL; grant select on sys.gv_$sysmetric_history to xormon_check CONTAINER = ALL; grant select on sys.v_$datafile to xormon_check CONTAINER = ALL; grant select on sys.gv_$datafile to xormon_check CONTAINER = ALL; grant select on sys.v_$filestat to xormon_check CONTAINER = ALL; grant select on sys.gv_$filestat to xormon_check CONTAINER = ALL; grant select on sys.v_$instance to xormon_check CONTAINER = ALL; grant select on sys.gv_$instance to xormon_check CONTAINER = ALL; grant select on sys.v_$database to xormon_check CONTAINER = ALL; grant select on sys.gv_$database to xormon_check CONTAINER = ALL; grant select on sys.v_$osstat to xormon_check CONTAINER = ALL; grant select on sys.gv_$osstat to xormon_check CONTAINER = ALL; grant select on sys.v_$session to xormon_check CONTAINER = ALL; grant select on sys.gv_$session to xormon_check CONTAINER = ALL; grant select on sys.v_$sgainfo to xormon_check CONTAINER = ALL; grant select on sys.gv_$sgainfo to xormon_check CONTAINER = ALL; grant select on sys.v_$containers to xormon_check CONTAINER = ALL; grant select on sys.gv_$containers to xormon_check CONTAINER = ALL; grant select on sys.v_$pgastat to xormon_check CONTAINER = ALL; grant select on sys.gv_$pgastat to xormon_check CONTAINER = ALL; grant select on sys.v_$system_wait_class to xormon_check CONTAINER = ALL; grant select on sys.gv_$system_wait_class to xormon_check CONTAINER = ALL; grant select on sys.v_$system_event to xormon_check CONTAINER = ALL; grant select on sys.gv_$system_event to xormon_check CONTAINER = ALL; grant select on sys.v_$con_sysmetric_summary to xormon_check CONTAINER = ALL; grant select on sys.gv_$con_sysmetric_summary to xormon_check CONTAINER = ALL; grant select on sys.v_$con_sysmetric_history to xormon_check CONTAINER = ALL; grant select on sys.gv_$con_sysmetric_history to xormon_check CONTAINER = ALL; grant select on sys.v_$cluster_interconnects to xormon_check CONTAINER = ALL; grant select on sys.gv_$cluster_interconnects to xormon_check CONTAINER = ALL; grant select on sys.v_$sysstat to xormon_check CONTAINER = ALL; grant select on sys.gv_$sysstat to xormon_check CONTAINER = ALL; grant select on sys.v_$service_stats to xormon_check CONTAINER = ALL; grant select on sys.gv_$service_stats to xormon_check CONTAINER = ALL; grant select on sys.v_$event_histogram to xormon_check CONTAINER = ALL; grant select on sys.gv_$event_histogram to xormon_check CONTAINER = ALL; grant select on dba_free_space to xormon_check CONTAINER = ALL; grant select on dba_temp_free_space to xormon_check CONTAINER = ALL; grant select on dba_data_files to xormon_check CONTAINER = ALL; grant select on dba_registry to xormon_check CONTAINER = ALL; grant select on dba_temp_files to xormon_check CONTAINER = ALL; grant select on sys.registry$history to xormon_check CONTAINER = ALL; grant select on sys.REGISTRY$SQLPATCH to xormon_check CONTAINER = ALL; grant select on sys.v_$recovery_file_dest to xormon_check CONTAINER = ALL; grant select on sys.v_$log to xormon_check CONTAINER = ALL; grant select on sys.v_$controlfile to xormon_check CONTAINER = ALL; grant select on dba_alert_history_detail to xormon_check CONTAINER = ALL; grant select on sys.v_$logfile to xormon_check CONTAINER = ALL; exit;
grant select on sys.v_$dataguard_config to xormon_check; grant select on sys.v_$ARCHIVE_DEST to xormon_check; grant select on sys.v_$archive_dest_status to xormon_check;
grant select on sys.v_$dataguard_config to xormon_check CONTAINER = ALL; grant select on sys.v_$ARCHIVE_DEST to xormon_check CONTAINER = ALL; grant select on sys.v_$archive_dest_status to xormon_check CONTAINER = ALL;
SQL> grant SET CONTAINER to xormon; ORA-00990: missing or invalid privilege SQL> grant select on sys.REGISTRY$SQLPATCH to xormon; ORA-00942: the table does not exist
yum install unixODBC unixODBC-devel freetdsNote: Make sure the driver path is present in "/etc/odbcinst.ini" (Most installations will do this automatically)
$ cat /etc/odbcinst.ini # Driver from the freetds-libs package # Setup from the unixODBC package [FreeTDS] Description = Free Sybase & MS SQL Driver Driver = /usr/lib/libtdsodbc.so Setup = /usr/lib/libtdsS.so
# rpm -q perl-DBI perl-DBD-ODBC perl-DBI-1.627-4.el7.x86_64 perl-DBD-ODBC-1.50-3.el7.x86_64Install them if they are missing under root user (Linux RedHat, CentOS):
# yum install perl-DBD-ODBC
CREATE LOGIN xormon WITH PASSWORD = 'your_passw0rd'; CREATE USER xormon FOR LOGIN xormon; GRANT CONNECT ANY DATABASE TO xormon; USE master; GRANT VIEW SERVER STATE TO xormon;
# under root umask 022 cd /tmp tar xvfz /tmp/ibm_data_server_driver_package_linuxx64_v11.5.tar.gz cd /tmp/dsdriver ./installDSDriver . ./db2profile export DB2_HOME=/tmp/dsdriver export DB2LIB=/tmp/dsdriver/lib cpanm DBD::DB2 # copy DB2 libraries to /usr/local/lib cp -r /tmp/dsdriver/lib/* /usr/local/lib/ # and index them for usage Ldconfig /usr/local/lib # test Perl DBD::DB2 module (there should be no errors) perl -MDBD::DB2 -le 'print $DBD::DB2::VERSION' rm -rf /tmp/dsdriver /tmp/ibm_data_server_driver_package_linuxx64_v11.5.tar.gz
GRANT createtab,bindadd,connect ON DATABASE TO USER xormon; GRANT EXECUTE ON FUNCTION SYSPROC.* TO USER xormon; GRANT EXECUTE ON PROCEDURE SYSPROC.* TO USER xormon; GRANT SELECT ON TABLE SYSIBMADM.DB2_MEMBER TO USER xormon; CREATE SCHEMA xormon;