ikzelf / zbxora

Zabbix Oracle monitoring plugin - replaced by zbxdb
42 stars 21 forks source link

Monitor Oracle installed on windows Host #19

Closed starlessboi closed 5 years ago

starlessboi commented 5 years ago

Hi again I have an oracle Instance installed on windows host, as far as I see, scripts are in bash and python, How can I monitor oracle on windows with zbxora, Or do you have any idea to monitor that with another tools or scripts? thanks

ikzelf commented 4 years ago

Did you export the variables? Did you source the .bash_profile?

export ZABBIX_SERVERS=a.b.c.d

ikzelf commented 4 years ago

and also: main zbxdb_sender needs zabbix_sender in PATH you need to install zabbix_sender

amberchandel commented 4 years ago

Sir My config file name is zbxdb.ZBXDB_NDLI_19.cfg so my hostname will be ZBXDB_NDLI_19 or zbxdb.ZBXDB_NDLI_19 ?? I have created host on zabbix server with name ZBXDB_NDLI_19 is it correct?

amberchandel commented 4 years ago

I didn't understand this "and also: main zbxdb_sender needs zabbix_sender in PATH you need to install zabbix_sender"

how to install zabbix sender now

amberchandel commented 4 years ago

i forgot to export. Thnx Sir, Now I can see the and port

[jboss@TEST-UAT-63-95 ~]$ zbxdb_sender.py 2020-04-15 21:19:13,153_main ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-15 21:19:13,153_main Logging in /home/jboss/log/zbxdb_sender.log 2020-04-15 21:19:13,153_main zbxdb_sender needs zabbix_sender in PATH

ikzelf commented 4 years ago

the hostname should be equal to what you wrote in the cfg file as "hostname=yourhostname" It could be the same as a part of the filename but that is not used for that.

yum install zabbix-sender

amberchandel commented 4 years ago

the hostname should be equal to what you wrote in the cfg file as "hostname=yourhostname" I exactly followed this rule as I read this in documentation now I am configuring cron and post that I will install zabbix-sender. Am I on right track after all mentioned step will i be able to see items in my host??

ikzelf commented 4 years ago

I hope so. If you created crontab like this:

and have the pyenv definition in .bash_profile it could work.

amberchandel commented 4 years ago

I tried running yum install zabbix-sender but encounterd a problem please help is it installed or an issue as it is stating -: No package zabbix-sender available.

[root@TEST-UAT-63-95 jboss]# yum install zabbix-sender Loaded plugins: product-id, search-disabled-repos, subscription-manager This system is not registered with an entitlement server. You can use subscription-manager to register. RHEL-7.4-x86_64 | 2.9 kB 00:00:00 RHEL-7.4-x86_64/x86_64/primary_db | 5.3 MB 00:00:00 No package zabbix-sender available. Error: Nothing to do [root@TEST-UAT-63-95 jboss]#

ikzelf commented 4 years ago

Check with your admins.

amberchandel commented 4 years ago

Sir its an rhel 8 machine

admins??

ikzelf commented 4 years ago

You are missing the zabbix repository in /etc/yum.repos.d/ Who installed this machine for you? He/she can almost certainly help you with this. you can pick it from here: rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm

amberchandel commented 4 years ago

I have dowloaded the rpm package and installed

[root@TEST-UAT-63-95 jboss]# rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm Retrieving https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm warning: /var/tmp/rpm-tmp.Y0LNe6: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY Preparing... ################################# [100%] package zabbix-release-4.4-1.el8.noarch is already installed

I configured the cron also

amberchandel commented 4 years ago

Now how to load template sir?? I still cannnot see any item on my host "ZBXDB_NDLI_19"

ikzelf commented 4 years ago

That is because you did not upload the template. You can import it via the zabbix GUI. After that attach it to your hostname.

amberchandel commented 4 years ago

Hi Sir,

I have uploaded the template zbxdb_template_v4.xml and linked it to ZBXDB_NDLI_19 host. Now I can see the items, but there is no data because of oracle client absence.

But I cannot see any error so far in any log file of db connection since oracle client is not installed. where the error will be shown??

ikzelf commented 4 years ago

Is zbxdb.py running? Is zbxdb_sender.py sending the files every minute?

What is in the log directory? Wat is written in the zbxdb_out/ files?

Did you install zabbix_sender? Without zabbix_sender there will be no data in zabbix.

amberchandel commented 4 years ago

Is zbxdb.py running? cron are running

zbxdb_starter.cron log mon etc/zbxdb.ZBXDB_NDLI_19.cfg jboss 4229 1 0 22:01 ? 00:00:00 /home/jboss/.pyenv/versions/3.6.5/bin/python3 /home/jboss/zbxdb/bin/zbxdb.py -c etc/zbxdb.ZBXDB_NDLI_19.cfg 0

Is zbxdb_sender.py sending the files every minute?

Log for zbxdb_sender.cron

2020-04-15 23:04:02,073_main ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-15 23:04:02,073_main Logging in /home/jboss/log/zbxdb_sender.log 2020-04-15 23:04:02,074_main zbxdb_sender needs zabbix_sender in PATH

What is in the log directory?

/home/jboss/log [jboss@TEST-UAT-63-95 log]$ ls -l total 64 -rw-rw-r--. 1 jboss jboss 237 Apr 15 23:06 zbxdb_sender.cron -rw-rw-r--. 1 jboss jboss 18448 Apr 15 23:06 zbxdb_sender.log -rw-rw-r--. 1 jboss jboss 174 Apr 15 23:06 zbxdb_starter.cron -rw-rw-r--. 1 jboss jboss 34315 Apr 15 23:05 zbxdb_starter.py.log [jboss@TEST-UAT-63-95 log]$

Wat is written in the zbxdb_out/ files? there is only one file in /home/jboss/zbxdb_out which is zbxdb.ZBXDB_NDLI_19.zbx no zbx_out files present

Did you install zabbix_sender? yes

Without zabbix_sender there will be no data in zabbix.

ikzelf commented 4 years ago

Zabbix_sender.log shows: need zabbix_sender in PATH.

So, if you did install zabbix_sender, add the install location to PATH.

amberchandel commented 4 years ago

This is how I installed zabbix-sender, I installed it through root user but I am not able to find in which path it has been instlled. and my zbxdb_sender folder is also empty.

[root@TEST-UAT-63-95 jboss]# rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm Retrieving https://repo.zabbix.com/zabbix/4.4/rhel/8/x86_64/zabbix-release-4.4-1.el8.noarch.rpm warning: /var/tmp/rpm-tmp.Y0LNe6: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY Preparing... ################################# [100%] package zabbix-release-4.4-1.el8.noarch is already installed

amberchandel commented 4 years ago

I read thi from documentation zbxdb_sender will check $ZBXDB_OUT/ and move the contents to $HOME/zxbdb_sender/in/. Next it will send the files to zabbix and keep a few days of history in $HOME/zbxdb_sender/archive/

I don't knw where zabbix_sender has been installed

amberchandel commented 4 years ago

I have installed zabbix sender in redhat server through root user . It is installed. But I cannot see zabbix-sender directory under usr/bin or usr/local/bin, usr/local/sbin.

ikzelf commented 4 years ago

Given the complaint of zbxdb_sender.py, zabbix_sender is not installed. You did install the zabbix rpm that installed the zabbix.repo in /etc/yum.repos.d/ but somehow you can not reach the zabbix yum repository.

You could use the url I sent you earlier to find the zabbix-sender rpm, download it and install from the rpm directly.

amberchandel commented 4 years ago

Ok I am installing that. Post Zabbix_sender path wht else is left to do? I cannot see aany log stating that db connection failed

ikzelf commented 4 years ago

If the db connection fails, the error will be in log/zbxdb.{yourconfig}.log file. If the sender can upload the data, it will also be visible in zabbix.

Normally, after install, zabbix_sender is in your PATH. Could be in /usr/bin/ if I am not mistaken.

What data is in your file in zbxdb_out/

Does sender.log still complain? It should add loglines every minute....

amberchandel commented 4 years ago

Sir I was looking where zabbix_sender was installed, I found some directories has been created in my /data01 mount

shall I delete them and reinsatall or set the path of this directory for zabbix_sender i.e /data01/bin/??

[jboss@TEST-UAT-63-95 data01]$ pwd /data01 [jboss@TEST-UAT-63-95 data01]$ ls -altr -rw-r--r--. 1 root root 1975750 Mar 5 13:34 redis-5.0.5.tar.gz drwxrwxr-x. 6 root root 4096 Mar 18 12:53 redis-5.0.5 drwxrwxr-x. 6 zabbix zabbix 253 Mar 23 17:51 . drwxrwxr-x. 2 zabbix zabbix 27 Mar 23 17:52 sbin drwxrwxr-x. 3 zabbix zabbix 53 Mar 23 17:52 conf drwxrwxr-x. 2 zabbix zabbix 45 Mar 23 17:52 bin

[jboss@TEST-UAT-63-95 data01]$ cd bin/ You have new mail in /var/spool/mail/jboss [jboss@TEST-UAT-63-95 bin]$ ls -l total 2512 -rwxrwxr-x. 1 zabbix zabbix 1066056 Mar 23 17:52 zabbix_get -rwxrwxr-x. 1 zabbix zabbix 1501112 Mar 23 17:52 zabbix_sender [jboss@TEST-UAT-63-95 bin]$

amberchandel commented 4 years ago

I added above described path in $PATH now the logs of "zbxdb_sender.cron"

2020-04-16 00:15:01,435_main ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:15:01,436_main Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:15:01,436_main removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock

I also checked zbxdb-sender directory where i found below files and folders

[jboss@TEST-UAT-63-95 ~]$ cd /home/jboss/zbxdb_sender [jboss@TEST-UAT-63-95 zbxdb_sender]$ ls -l total 0 drwxrwxr-x. 2 jboss jboss 99 Apr 16 00:16 archive drwxrwxr-x. 2 jboss jboss 6 Apr 16 00:16 in [jboss@TEST-UAT-63-95 zbxdb_sender]$ ls -l archive/ total 12 -rw-rw-r--. 1 jboss jboss 1038 Apr 16 00:12 zbx_2020-04-16-0012.zip -rw-rw-r--. 1 jboss jboss 229 Apr 16 00:14 zbx_2020-04-16-0014.zip -rw-rw-r--. 1 jboss jboss 229 Apr 16 00:16 zbx_2020-04-16-0016.zip

ikzelf commented 4 years ago

I have no idea why they are in that location. You could add the containing directory to your PATH (in .bash_profile) and see what changes in the sender log.

Btw: I suspect that your crontab is generating errors(you have mail if often a sign of that)

Does your .zbx file grow every minute?(it should be) Same as for the sender.log

amberchandel commented 4 years ago

shall i check cron logs to check if some error is coming??

amberchandel commented 4 years ago

Hi Sir I can.t see zbxdb.ZBXDB_NDLI_19.zbx file which was present in /home/jboss/zbxdb_out folder anymore i dont whether it got deleted or moved to zabbix server?

sender.log are getting updated every minute

2020-04-16 00:18:01,618main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:19:02,944main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:19:02,944main30_Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:19:02,945main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:20:02,346main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:20:02,346main30_Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:20:02,347main30_2020-04-16-0020 processing zbxdb.ZBXDB_NDLI_19.zbx 2020-04-16 00:20:02,358main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:21:01,661main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:21:01,661main30_Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:21:01,663main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:22:03,009main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:22:03,009main30_Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:22:03,010main30_2020-04-16-0022 processing zbxdb.ZBXDB_NDLI_19.zbx 2020-04-16 00:22:03,021main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:23:02,423main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:23:02,423main30_Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:23:02,424main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:24:01,812main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:24:01,812main30_Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:24:01,813main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:25:02,131main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:25:02,132main30_Logging in /home/jboss/log/zbxdb_sender.log 2020-04-16 00:25:02,133main30_2020-04-16-0025 processing zbxdb.ZBXDB_NDLI_19.zbx 2020-04-16 00:25:02,144main30_removed lock /home/jboss/zbxdb_sender/zbxdb_sender.lock 2020-04-16 00:26:01,448main30_ZABBIX_SERVERS 10.1.61.161 ZABBIX_SERVER_PORTS 10050 2020-04-16 00:26:01,448main30_Logging in /home/jboss/log/zbxdb_sender.log

amberchandel commented 4 years ago

hi sir this is cron log which says that cron is getting executed in every minute.

Apr 16 00:39:01 TEST-UAT-63-95 CROND[55520]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1) Apr 16 00:40:01 TEST-UAT-63-95 CROND[55826]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_sender.py >$HOME/log/zbxdb_sender.cron 2>&1) Apr 16 00:40:01 TEST-UAT-63-95 CROND[55827]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1) Apr 16 00:40:01 TEST-UAT-63-95 CROND[55828]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:40:01 TEST-UAT-63-95 CROND[55829]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:41:01 TEST-UAT-63-95 CROND[56138]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1) Apr 16 00:41:01 TEST-UAT-63-95 CROND[56141]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:41:01 TEST-UAT-63-95 CROND[56142]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_sender.py >$HOME/log/zbxdb_sender.cron 2>&1) Apr 16 00:42:02 TEST-UAT-63-95 CROND[56445]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_sender.py >$HOME/log/zbxdb_sender.cron 2>&1) Apr 16 00:42:02 TEST-UAT-63-95 CROND[56444]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:42:02 TEST-UAT-63-95 CROND[56446]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1) Apr 16 00:43:01 TEST-UAT-63-95 CROND[56751]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_sender.py >$HOME/log/zbxdb_sender.cron 2>&1) Apr 16 00:43:01 TEST-UAT-63-95 CROND[56750]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1) Apr 16 00:43:01 TEST-UAT-63-95 CROND[56752]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:44:01 TEST-UAT-63-95 CROND[57102]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1) Apr 16 00:44:01 TEST-UAT-63-95 CROND[57104]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_sender.py >$HOME/log/zbxdb_sender.cron 2>&1) Apr 16 00:44:01 TEST-UAT-63-95 CROND[57103]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:45:01 TEST-UAT-63-95 CROND[57411]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:45:01 TEST-UAT-63-95 CROND[57413]: (root) CMD (/usr/bin/puppet agent --verbose --no-daemonize --onetime --logdest syslog > /dev/null 2>&1) Apr 16 00:45:01 TEST-UAT-63-95 CROND[57410]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_sender.py >$HOME/log/zbxdb_sender.cron 2>&1) Apr 16 00:45:01 TEST-UAT-63-95 CROND[57412]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1) Apr 16 00:45:48 TEST-UAT-63-95 crontab[58102]: (root) LIST (root) Apr 16 00:45:48 TEST-UAT-63-95 crontab[58102]: PAM pam_end: NULL pam handle passed Apr 16 00:46:01 TEST-UAT-63-95 CROND[58125]: (root) CMD (/usr/lib64/sa/sa1 1 1) Apr 16 00:46:01 TEST-UAT-63-95 CROND[58126]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_sender.py >$HOME/log/zbxdb_sender.cron 2>&1) Apr 16 00:46:01 TEST-UAT-63-95 CROND[58127]: (jboss) CMD (. $HOME/.bash_profile;$HOME/zbxdb/bin/zbxdb_starter.py >$HOME/log/zbxdb_starter.cron 2>&1)

ikzelf commented 4 years ago

As far as I can see, sender is happily sending. I can only hope that it is to the correct address.

In zbxdb_sender/archive/ the processed files are saved for reference.... You could unzip one and read a .zbx file. It should contain a key, hostname, value and a unixtimestamp. I expect at least a key like zbxdb[connect,status] And usually quite a few more.

If the hostname in there matches your hostname in zabbix, you should be able to see data coming in.

Otherwise: adjust the hostname parameter in your .cfg file.

Check the zabbix_server.log

amberchandel commented 4 years ago

please check this is what is printing inside a zip folder present in zbxdb_sender/archive/

ZBXDB_NDLI_19 "zbxdb[checks,0,name]" 1586961055 /home/jboss/zbxdb/bin/zbxdb.py ZBXDB_NDLI_19 "zbxdb[checks,0,lmod]" 1586961055 1585205674 ZBXDB_NDLI_19 "zbxdb[checks,1,name]" 1586961055 /home/jboss/zbxdb/bin/dbconnections/oracle.py ZBXDB_NDLI_19 "zbxdb[checks,1,lmod]" 1586961055 1585205674 ZBXDB_NDLI_19 "zbxdb[checks,2,name]" 1586961055 /home/jboss/zbxdb/bin/drivererrors/cx_Oracle.py ZBXDB_NDLI_19 "zbxdb[checks,2,lmod]" 1586961055 1585205674 ZBXDB_NDLI_19 "zbxdb[connect,status]" 1586961055 0 ZBXDB_NDLI_19 "zbxdb[connect,status]" 1586961056 0 ZBXDB_NDLI_19 "zbxdb[connect,status]" 1586961164 0 ZBXDB_NDLI_19 "zbxdb[checks,0,name]" 1586962813 /home/jboss/zbxdb/bin/zbxdb.py ZBXDB_NDLI_19 "zbxdb[checks,0,lmod]" 1586962813 1585205674 ZBXDB_NDLI_19 "zbxdb[checks,1,name]" 1586962813 /home/jboss/zbxdb/bin/dbconnections/oracle.py ZBXDB_NDLI_19 "zbxdb[checks,1,lmod]" 1586962813 1585205674 ZBXDB_NDLI_19 "zbxdb[checks,2,name]" 1586962813 /home/jboss/zbxdb/bin/drivererrors/cx_Oracle.py ZBXDB_NDLI_19 "zbxdb[checks,2,lmod]" 1586962813 1585205674 ZBXDB_NDLI_19 "zbxdb[connect,status]" 1586962813 0

ikzelf commented 4 years ago

This should arrive in zabbix, if zabbix accepts it. Hostname is case sensitive. I don’t trust the connect status 0. For that I have to check the code, tomorrow.

Status: generating some data about zbxdb.py files and the connection. Missing lots of other data so I think zbxdb.py is crashing.

What is in zbxdb.{your cfg}.log? What gives date; ps -fu$UID ?

amberchandel commented 4 years ago

Sir I have not installed oracle client till now so may be its 0 because of that.

where zbxdb.{your cfg}.log gets generated they are not present in log folder.

Output of date; ps -fu$UID

[jboss@TEST-UAT-63-95 ~]$ date; ps -fu$UID Thu Apr 16 01:22:42 IST 2020 UID PID PPID C STIME TTY TIME CMD jboss 3152 3148 0 Apr15 ? 00:00:00 sshd: jboss@pts/3 jboss 3153 3152 0 Apr15 pts/3 00:00:00 -bash jboss 3791 3787 0 Apr15 ? 00:00:00 sshd: jboss@notty jboss 3792 3791 0 Apr15 ? 00:00:00 /usr/libexec/openssh/sftp-server jboss 4229 1 0 Apr15 ? 00:00:01 /home/jboss/.pyenv/versions/3.6.5/bin/python3 /home/jboss/zbxdb/bin/zbxdb.py -c etc/zbxdb.ZBXDB_NDLI_19.cfg jboss 46445 46441 0 00:11 ? 00:00:00 sshd: jboss@notty jboss 46446 46445 0 00:11 ? 00:00:00 /usr/libexec/openssh/sftp-server jboss 57651 57621 0 00:45 ? 00:00:00 sshd: jboss@notty jboss 57753 57651 0 00:45 ? 00:00:00 /usr/libexec/openssh/sftp-server jboss 70159 3153 0 01:22 pts/3 00:00:00 ps -fu1000 jboss 100717 100713 0 Apr15 ? 00:00:00 sshd: jboss@notty jboss 100718 100717 0 Apr15 ? 00:00:00 /usr/libexec/openssh/sftp-server jboss 100857 100853 0 Apr15 ? 00:00:00 sshd: jboss@notty jboss 100858 100857 0 Apr15 ? 00:00:00 /usr/libexec/openssh/sftp-server jboss 101219 101215 0 Apr15 ? 00:00:00 sshd: jboss@notty jboss 101220 101219 0 Apr15 ? 00:00:00 -bash jboss 104831 104827 0 Apr15 ? 00:00:01 sshd: jboss@pts/1 jboss 104832 104831 0 Apr15 pts/1 00:00:00 -bash jboss 128565 128561 0 Apr15 ? 00:00:00 sshd: jboss@pts/2 jboss 128566 128565 0 Apr15 pts/2 00:00:00 -bash [jboss@TEST-UAT-63-95 ~]$

ikzelf commented 4 years ago

Ok, so zbxdb.py still keeps running. That is nice. I accidentally found that when the cx_oracle driver is loaded, it returns error 0, normally OK, when the connect is tried( and fails because of: no client installed). In that situation I would like to send the error message to zabbix.

Strange that you have no logfiles. Is the error log in the starter.log?

Did you also copy the logging.json (you did do that for the sender version)

amberchandel commented 4 years ago

This should arrive in zabbix, if zabbix accepts it. Hostname is case sensitive. I don’t trust the connect status 0. For that I have to check the code, tomorrow.

I didn't understand what should arrrive in zabbix and is the data is incorrect ??

the log which is coming in zip file sjould come in zabbix??

amberchandel commented 4 years ago

Sir I have just copied the logging.json in $HOME/etc folder now the logs will start generating for .cfg file??

ikzelf commented 4 years ago

No, since zbxdb.py does not know this file - yet - it will find no reason to [re]read it. move your cfg file out of the etc/ directory and after a minute move it back in. It will detect the file is missing and stop. On the next minute zbxdb_starter.py will try to start it again, if you did put the cfg file back in the etc/ directory.

amberchandel commented 4 years ago

Ok , Sir I have a doubt the .zbx file whch is created in zbx_out folder comes and gets disappear is it movinf somewhere else or getting deleted?? So now till now everythng is ok and runninng correctly??

ikzelf commented 4 years ago

Apart from the fact that I think this " WARNING:main:(1.1)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for " should be handled better.

And: do you see data arriving in zabbix? From zbxdb perspective it is all OK, as soon as the driver is correctly installed.

amberchandel commented 4 years ago

Log for zbxdb.ZBXDB_NDLI_19.cfg.log

2020-04-16 01:54:03,088main30_start python-3.6.5 zbxdb-2.06 pid=80508 Connecting ...

2020-04-16 01:54:03,088main30_zbxdb found db_type=oracle, driver cx_Oracle; checking for driver

2020-04-16 01:54:03,092main20_<module 'cx_Oracle' from '/home/jboss/.pyenv/versions/3.6.5/lib/python3.6/site-packages/cx_Oracle.cpython-36m-x86_64-linux-gnu.so'> 2020-04-16 01:54:03,092main20_zbxdb driver cx_Oracle loaded

2020-04-16 01:54:03,093main20_zbxdb driver drivererrors for cx_Oracle loaded

2020-04-16 01:54:03,094main20_zbxdb dbconnections for oracle loaded

2020-04-16 01:54:03,094main20_<module 'dbconnections.oracle' from '/home/jboss/zbxdb/bin/dbconnections/oracle.py'> 2020-04-16 01:54:03,094main20_<module 'drivererrors.cx_Oracle' from '/home/jboss/zbxdb/bin/drivererrors/cx_Oracle.py'> 2020-04-16 01:54:03,094main20_hostname in zabbix: ZBXDB_NDLI_19 2020-04-16 01:54:03,094main20_connect string : c##cistats/**@//10.1.63.123:1523/ndli19

2020-04-16 01:54:03,094main20_using sql_timeout : 60s

2020-04-16 01:54:03,094main20_out_file : /home/jboss/zbxdb_out/zbxdb.ZBXDB_NDLI_19.zbx

2020-04-16 01:54:03,094main20_site_checks : sap,ebs

2020-04-16 01:54:03,095main20_connecting to c##cistats/**@//10.1.63.123:1523/ndli19

2020-04-16 01:54:03,096main30_(1.1)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for c##cistats@//10.1.63.123:1523/ndli19

2020-04-16 01:54:04,099main20_connecting to c##cistats/**@//10.1.63.123:1523/ndli19

2020-04-16 01:54:04,100main30_(2.1)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for c##cistats@//10.1.63.123:1523/ndli19

2020-04-16 01:54:05,104main20_connecting to c##cistats/**@//10.1.63.123:1523/ndli19

2020-04-16 01:54:05,105main30_(3.1)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for c##cistats@//10.1.63.123:1523/ndli19

2020-04-16 01:54:06,109main20_connecting to c##cistats/**@//10.1.63.123:1523/ndli19

2020-04-16 01:54:06,110main30_(4.1)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for c##cistats@//10.1.63.123:1523/ndli19

2020-04-16 01:54:07,114main20_connecting to c##cistats/**@//10.1.63.123:1523/ndli19

2020-04-16 01:54:07,115main30_(5.1)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for c##cistats@//10.1.63.123:1523/ndli19

2020-04-16 01:54:08,118main20_connecting to c##cistats/**@//10.1.63.123:1523/ndli19

2020-04-16 01:54:08,119main30_(6.1)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for c##cistats@//10.1.63.123:1523/ndli19

2020-04-16 01:54:09,123main20_connecting to c##cistats/**@//10.1.63.123:1523/ndli19

ikzelf commented 4 years ago

Something weird is going on: you run v2.06 and I fixed this specific driver error in 2.07, almost 2 weeks ago. I just pushed again to GitHub. Can you cd to zbxdb/ and issue a "git pull" Next, open zbxdb/bin/zbxdb.py and check line 38 ?

it should show : 36 import sqlparse 37 38 VERSION = "2.07" 39 40 41 def setup_logging(

amberchandel commented 4 years ago

Data will not arrive in zabbix till the time I don't insatlll oracle sql client for remote connection.

where you read this DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See ??

amberchandel commented 4 years ago

I have never done a git pull please guide me is it correct?? showing some error

[jboss@TEST-UAT-63-95 ~]$ cd /home/jboss/zbxdb You have new mail in /var/spool/mail/jboss [jboss@TEST-UAT-63-95 zbxdb]$ git pull fatal: Not a git repository (or any of the parent directories): .git

ikzelf commented 4 years ago

hmmmzzz ..... you earlier showed a git clone https://github.com/ikzelf/zbxdb.git .... where did dat go? cd rm -rf zbxdb git clone https://github.com/ikzelf/zbxdb.git

yes, as long as the client is not correctly installed you won't receive data about the database contents but you still should receive data about the failing connection. Check latest data for your hostname in zabbix.

amberchandel commented 4 years ago

actually I skipped this step as i had already downloaded the zbxdb.zip

right now in my zbxdb.py has VERSION = "2.06" on line 36

shall I follow below steps?? rm -rf zbxdb git clone https://github.com/ikzelf/zbxdb.git

amberchandel commented 4 years ago

I am not getting any value or data on zabbix

image

amberchandel commented 4 years ago

I follow below step

[jboss@TEST-UAT-63-95 zbxdb]$ cd ~ [jboss@TEST-UAT-63-95 ~]$ rm -rf zbxdb [jboss@TEST-UAT-63-95 ~]$ git clone https://github.com/ikzelf/zbxdb.git Cloning into 'zbxdb'... remote: Enumerating objects: 133, done. remote: Counting objects: 100% (133/133), done. remote: Compressing objects: 100% (97/97), done. remote: Total 1896 (delta 81), reused 72 (delta 36), pack-reused 1763 Receiving objects: 100% (1896/1896), 440.71 KiB | 383.00 KiB/s, done. Resolving deltas: 100% (1247/1247), done. You have new mail in /var/spool/mail/jboss

now i can see version VERSION = "2.07" on line 38

import sqlparse

VERSION = "2.07"

def setup_logging(

Sir there is one more issue zbxdb_starter is missing .py extension I have to add manually .py extension to make it work

amberchandel commented 4 years ago

After following above two seps of znxdb delete and clone I am facinig below issue

Error in zbxdb.ZBXDB_NDLI_19.cfg.log

**2020-04-16 02:41:02,430main50_problem Traceback (most recent call last): File "/home/jboss/zbxdb/bin/dbconnections/oracle.py", line 97, in connect _x = _db.connect(connect_string(_c), mode=_c['omode']) cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for h**elp

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/jboss/zbxdb/bin/zbxdb.py", line 396, in main _conn = db_connections.connect(db_driver, _config) File "/home/jboss/zbxdb/bin/dbconnections/oracle.py", line 107, in connect LOGGER.ERROR("connect failed %s with %s", _error.code, AttributeError: 'Logger' object has no attribute 'ERROR'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/jboss/zbxdb/bin/zbxdb.py", line 827, in main() File "/home/jboss/zbxdb/bin/zbxdb.py", line 788, in main err_code, err_msg = driver_errors.db_errorcode(db_driver, dberr) File "/home/jboss/zbxdb/bin/drivererrors/cx_Oracle.py", line 24, in db_errorcode return _error.code, str(excep.args[0]) AttributeError: 'str' object has no attribute 'code'****

output of zbxdb.ZBXDB_NDLI_19.zbx

ZBXDB_NDLI_19 "zbxdb[checks,0,name]" 1586985003 /home/jboss/zbxdb/bin/zbxdb.py ZBXDB_NDLI_19 "zbxdb[checks,0,lmod]" 1586985003 1586984326 ZBXDB_NDLI_19 "zbxdb[checks,1,name]" 1586985003 /home/jboss/zbxdb/bin/dbconnections/oracle.py ZBXDB_NDLI_19 "zbxdb[checks,1,lmod]" 1586985003 1586984326 ZBXDB_NDLI_19 "zbxdb[checks,2,name]" 1586985003 /home/jboss/zbxdb/bin/drivererrors/cx_Oracle.py ZBXDB_NDLI_19 "zbxdb[checks,2,lmod]" 1586985003 1586984326 ZBXDB_NDLI_19 "zbxdb[checks,3,name]" 1586985003 etc/logging.json ZBXDB_NDLI_19 "zbxdb[checks,3,lmod]" 1586985003 1585205674

OUTPUT of zbxdb.log

2020-04-16 01:54:03,087main20_Continue logging in /home/jboss/log/zbxdb.ZBXDB_NDLI_19.cfg.log 2020-04-16 02:38:02,313main20_Continue logging in /home/jboss/log/zbxdb.ZBXDB_NDLI_19.cfg.log 2020-04-16 02:39:02,745main20_Continue logging in /home/jboss/log/zbxdb.ZBXDB_NDLI_19.cfg.log 2020-04-16 02:40:03,120main20_Continue logging in /home/jboss/log/zbxdb.ZBXDB_NDLI_19.cfg.log 2020-04-16 02:41:02,420main20_Continue logging in /home/jboss/log/zbxdb.ZBXDB_NDLI_19.cfg.log

O/P of zbxdb_starter.py.log

INFO:main:connecting to c##cistats/**@//10.1.63.123:1523/ndli19

WARNING:main:(8.161)connection error: [0] DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help for c##cistats@//10.1.63.123:1523/ndli19

CRITICAL:main:problem Traceback (most recent call last): File "/home/jboss/zbxdb/bin/zbxdb.py", line 386, in main _config = get_config(_args.configfile, ME) File "/home/jboss/zbxdb/bin/zbxdb.py", line 153, in get_config raise ValueError("Configfile " + filename + " does not exist") ValueError: Configfile etc/zbxdb.ZBXDB_NDLI_19.cfg does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/jboss/zbxdb/bin/zbxdb.py", line 820, in main() File "/home/jboss/zbxdb/bin/zbxdb.py", line 785, in main err_code, err_msg = driver_errors.db_errorcode(db_driver, dberr) File "/home/jboss/zbxdb/bin/drivererrors/cx_Oracle.py", line 24, in db_errorcode return _error.code, str(excep.args[0]) AttributeError: 'str' object has no attribute 'code' Thu Apr 16 01:54:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:38:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:39:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:40:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:41:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:42:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:43:01 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:44:01 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:45:03 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:46:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:47:02 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:48:01 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:49:03 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg Thu Apr 16 02:50:01 IST 2020 Starting etc/zbxdb.ZBXDB_NDLI_19.cfg