0

I have one virtual server running on centos7. I configure it for the Nagios monitoring tool. I created the config file etc. I have 9 DB instances. When I migrated the DB config file with Nagios(adding to the Nagios )

I saw this error code on http://mysiteipaddr/nagios

CRITICAL - cannot connect to db.ipaddress.com. install_driver(DB2) failed: Can't locate DBD/DB2.pm in @INC (@INC contains: /usr/local/nagios/libexec /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at (eval 10) line 3.

After this error, I realize the DB2 is not installed on my machine. I've installed the DB2 drivers and when I execute this command I'm facing this output.

 db2ls
-------------------------------------------------------------------------------------------------------------------
/opt/ibm/db2/V9.7                11.1.1.1        1                            Fri Jan 31 11:33:28 2020 +03             0
[root@backup ~]# 

But when I want to execute DB2 command like db2start, db2stop, db2status, it won't execute and I got this error code.

bash: db2stop: command not found 
bash: db2start:command not found
mustaccio
  • 18,234
  • 16
  • 48
  • 57
  • Have you "source"d the Db2 environment? There is a script to include into bashrc or profile – data_henrik Jan 31 '20 at 14:21
  • Your question is unclear. What is the full name of the Db2 driver that you installed? For example: the Db2 runtime client, or the ODBC and jdbc client, or the full Db2 client? The `db2start` command is part of the *Db2-server*. It's not necessary to start a Db2-client, but *depending on which Db2-client* you installed you may need to dot in its db2profile , or at the very least, the client's binaries directory has to be on the PATH for the account that runs nagios before you start nagios. – mao Jan 31 '20 at 14:45
  • Hey, Thank you for your kindly helps mao. When I execute " db2ls -p -q -b /opt/ibm/db2/V9.7/" output shows me this. Product Response File ID Level Fix Pack Product Description --------------------------------------------------------------------------------------------------------------------- EXPRESS_C 11.1.1.1 1 DB2 Express-C – Batuhan Ozoguz Feb 03 '20 at 13:01
  • Learn how to edit your question. Learn how to describe your environment. Are all 9 Db2-instances up and running? Are they local or remote (relative to nagios)? Are you using a different Db2-instance for nagios, and have you dotted in its instance-profile for the account that runs nagios? Do not give answers in comments, they get lost, but instead EDIT your question with new facts. – mao Feb 04 '20 at 14:51

3 Answers3

1

Do you have an instance created? run /opt/ibm/db2/V9.7/instance/db2ilist

Vicki Chen
  • 11
  • 1
0

Please check the folder /home/tobe/sqllib/adm for db2start and db2stop commands. You can also define an alias if you want to call them directly.

Tuncer T.
  • 23
  • 1
  • 4
0

Install below package in all of the instances:

yum -y install perl-CPAN

hope so this will be helpful for you....!!!!

Deepak Sharma
  • 331
  • 3
  • 11