ikzelf / zbxora

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

I don't recall having created those ..... but what you need to do is add a file in your etc/zbxdb_checks/ with a unique name and fill that with queries that return a key as listed, with the value as you want it. #22

Closed amberchandel closed 4 years ago

amberchandel commented 4 years ago

I don't recall having created those ..... but what you need to do is add a file in your etc/zbxdb_checks/ with a unique name and fill that with queries that return a key as listed, with the value as you want it. Take the queries in primary* as examples.

Originally posted by @ikzelf in https://github.com/ikzelf/zbxora/issues/19#issuecomment-619077760

amberchandel commented 4 years ago

Hi @ikzelf DO i need to create an entry in template as well for the new data?? For example I want to use a script that should show me totatl SGA,PGA memory allocated,consumend and left do i need to add row for them in the template if yes than how to achieve that?

ikzelf commented 4 years ago

If you define items that are new, yes, you have to add them somewhere. You could add them to the zbxdb template but maybe is smarter to create an own template. It is your choice. For how to do that, may I suggest reading the excellent zabbix documentation on this subject? The queries that just have to generate simple values, just have to return a key and a value. The key, you define in zabbix as an item key and the type of item has to fit the value's you are expecting. zbxdb takes care for executing the query and passing the results in the correct format to zabbix.

amberchandel commented 4 years ago

Thnx Sir.

amberchandel commented 4 years ago

@ikzelf Hi Sir ,

I was just understanding how zbxdb is fetching values and sending it to zabbix I performed some steps and got some understanding. The steps were. Step 1-: I opened host which i created ZBXDB_NDLI_19 Step 2-: I opened discovery list in which I opened dbnames Step 3-: in dbnames there was a key db.lld whose value in primary.19.cfg was -: db.lld: select name "{#PDB}" from v$pdbs union select name from v$database where cdb = 'NO' I ran this query and got the names of multiple pdbs running on my cdb ndli19

There was 1 item-prototype present in dbnames whose name and key were {#PDB} openstatus, db[{#PDB},openstatus] respectively and in show value -: zbxdb db.openstatus was present whose values were given below.

zbxdb db.openstatus -: 0 ⇒ unknown 1 ⇒ MOUNTED 2 ⇒ READ ONLY 3 ⇒ READ WRITE 4 ⇒ READ ONLY WITH APPLY

I checked the template and found the name {#PDB} openstatus and key db[{#PDB},openstatus]

I extracted one of the zip in archive folder present in zabbix_sender folder and got this values. ZBXDB_NDLI_19 "db[INST_TEST,openstatus]" 1588247701 3

I got stuck on one point where is the query (I was not able to find that ) which gives the value that the pdbs are in read write condition and send 3 (Where it confirms 3 as 3 ⇒ READ WRITE) as an output to zabbix via zabbix-sender?

ikzelf commented 4 years ago

Hi, you are on the right path. There are 2 types of queries 1) discovery queries that feed the lld keys 2) the metrics

There is a query that reads the open_mode from the database[s] and translates the modes to numbers. If all is OK, it should fit the value map you found.

amberchandel commented 4 years ago

Yes sir I want know,

Where are these low level discovery queries has beenconfigured which hits the database and returns 3 to zabbix server.

ikzelf commented 4 years ago

[checks_01m] minutes: 1 inst.uptime: select 'inst['||instance_name||',uptime]' key,(sysdate -startup_time)6060*24 val from gv$instance db.openmode: select 'db['||name||',openstatus]', decode(open_mode,'MOUNTED',1,'READ ONLY',2,'READ WRITE',3,'READ ONLY WITH APPLY',4,'MIGRATE',5, 0)

ikzelf commented 4 years ago

This query is in all versions of the oracle checks.

amberchandel commented 4 years ago

Hi Sir I found that I have written the queries which will return the value for eg how much archival space left and how much assigned and I have created a different file in Oracle check where I have saved these queries in that file now I am puzzled how to configure this with zbxdb and how I will get the data on zabbix frontend

ikzelf commented 4 years ago

Nice work. A fra check already exists but you can activate your file to the site_checks parameter. As an example I put the sap and ebs checks there. You can replace or remove them, what best suits you.

amberchandel commented 4 years ago

Sir I am not able to understand what lld and metrics do?? what I need to write so that the data can be interpreted and reflected at zabbix frontend, Mainly I don't have an idea what I have to do on Zabbix frontend to get the data DO I need to write a new template (which I don't know) and link it with existing template to get the data I don't know How to achieve that I am puzzled with all these questions

amberchandel commented 4 years ago

Please also tell me what are these sap and ebs check??

ikzelf commented 4 years ago

They are just examples of how site/application specific checks could look like.

amberchandel commented 4 years ago

https://github.com/ikzelf/zbxora/issues/22#issuecomment-623367897

please rply to my above query I am still not able to figure out how to send data and how to get data on zabbix frontend.

amberchandel commented 4 years ago

Hi SIr ,

arl_dest[{#INSTNAME}{#ARL_DEST}_status]

where these macros have been defined? I checked in the discovery rule lld macro I didn't find there.

ikzelf commented 4 years ago

They are defined by the columnnames in the lld query.

amberchandel commented 4 years ago

Sir ,

I have taken a very simple approach I will create an item with zabbix-trapper run a sql query through the client and send the output to zabbix server with help of zabbix sender.

I have written a query which returns total no of holder and waiter in a PDB now when I ran this quer on sqldeveloper or on putty I get below outputs (refer scrnsht) since zabbix takes only R1C1 i.e only one value than how shall I ignore this "COUNT" from the output and get only single digit so that I can send the output to zabbix frontend.

image

image

ikzelf commented 4 years ago

This is all taken care of by zbxdb

ikzelf commented 4 years ago

Could it be that you have an error message in your zabbix or proxy log like "connection of type "unencrypted" is not allowed for host "?

amberchandel commented 4 years ago

No Sir,

I didn't saw any such logs in my zabbix server logs

ikzelf commented 4 years ago

I got an other request regarding encryption. That should be working now.

amberchandel commented 4 years ago

Hi Ikzelf.

We have been using zbxdb and its wonderful tool you have created many thanx for the help.and contribution.

Now I am looking foralert log monitoring required your help please guide.

ikzelf commented 4 years ago

For alertlog monitoring you put zbx_alertlog.py in your database server[s] (with a correct python installation in them) Import the zbx_template_alertlog.xml and link this to your db server hosts in zabbix. The discovery rule uses a UserParameter and that should run zbx_alertlog.py This returns a list of all log.xml files of all your databases the script found on that server. BTW: you keep working in zbxora and I do not monitor zbxora very often. Smarter is it to ask for help in zbxdb, zbxdb is where you are working with.

amberchandel commented 4 years ago

Hi Ikzself,

My zbxdb has stopped monitoring what shall I check now for troubleshooting it. so that It can restart monitoring

amberchandel commented 4 years ago

zbxdbout log are printing properly but they are not being reflected on zabbix latest data

amberchandel commented 4 years ago

image

amberchandel commented 4 years ago

2020-09-10 10:02:04,669_main Logging in /home/jboss/log/zbxdb_sender.log 2020-09-10 10:02:04,670_main 2020-09-10-1002 previous run still running(or crashed(lock file: /home/jboss/zbxdb_sender/zbxdb_sender.lock))

amberchandel commented 4 years ago

In the zbxdb.ZBXDB_NDLI_19.zbx logs I Can clearly see that the vlues are being sent to zbbbix but they are not being reflected on Zabbix frontend.

amberchandel commented 4 years ago

Hi Ikzelf I figured it out what was the issue ... I think PID was killed due to low disk space . I restarted it, it worked fine.

ikzelf commented 4 years ago

This

10:02:04,670_main 2020-09-10-1002 previous run still running(or crashed(lock file: /home/jboss/zbxdb_sender/zbxdb_sender.lock))

Tells it all: the previous sender run is still running or crashed. If it is not running, just remove the .lock file and sending will continue.

Groeten, Ronald Rood

Op 10 sep. 2020 om 06:32 heeft amberchandel notifications@github.com het volgende geschreven:

 2020-09-10 10:02:04,669_main Logging in /home/jboss/log/zbxdb_sender.log 2020-09-10 10:02:04,670_main 2020-09-10-1002 previous run still running(or crashed(lock file: /home/jboss/zbxdb_sender/zbxdb_sender.lock))

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or unsubscribe.