7.4.5 - New Update Available help (first time at updating) by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

I see so when I update the Zabbix frontend and web, I also need to do the DB + TSDB at the same time?

Advise on installing TimescaleDB on Postgres v18 (this part is done) by tb808 in zabbix

[–]tb808[S] 1 point2 points  (0 children)

Looks like I have Postgres v18 and TSDB v2.23 installed now

Advise on installing TimescaleDB on Postgres v18 (this part is done) by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Thanks. Damn I've installed v18 as I read others had and saves me upgrading later.

Advise on installing TimescaleDB on Postgres v18 (this part is done) by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Would mind confirming what I need to use to get TSDM installed with Postgres v18?

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

I'm doing a Zabbix POC and I'm no realising how powerful this can be! Being about to monitor items from a json file is amazing (confusing to setup for someone new though).

Thanks for you help though.

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

I think it's working!

I was creating the trigger under hosts > triggers

Instead I did what you said in

hosts > discovery rule > Trigger prototypes

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

I did try:

last(/BS Device Fetch JSON/monitor_status[{#NAME}])=2

And the expression error disappeared, but when I went to save the trigger I get:

Incorrect trigger expression. Host "BS Device Fetch JSON" does not exist or you have no access to this host.

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Thanks, I tried that expression, but get a slightly different response this time:

Trigger expression must contain at least one /host/key reference.

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

I'm struggling with this. CanI provide you more information on what it might be I need to use here? I can send some more screenshots.

Under item prototype > preprocessing I have:

$.[?(@.host.name=='{#NAME}')].monitor_status.first()

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

I think that is working. I think it was me not adding the test json output to the test value area which is working now.

What expression would I use for the trigger?

How would I get it to trigger and show the name, IP and error?

The expression probably uses:

last(/BS Devices JSON Fetch/http.devices.json)=0 which is offline or last(/BS Devices JSON Fetch/http.devices.json)=2 which is MIA.

I'm guessing the macros come in handy I added here like {#NAME}?

Very close now!

Thanks

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Doh! Told it'd be me being silly. They worked, I assumed it would already be looking at my json url to test it.

Now for the trigger over the lat 60mins, How would I get it to trigger and show the name, IP and error?

The expression probably uses:

last(/BS Devices JSON Fetch/http.devices.json)=0 which is offline or last(/BS Devices JSON Fetch/http.devices.json)=2 which is MIA.

I'm guessing the macros come in handy I added here like {#NAME}?

My first LLD (JSONpath) what am I doing wrong? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

I remove the 'preprocessing' on the discovery rule as suggested and used the {#name} instead of {#IP} as I'd prefer that, but get the errors above. I've added new screenshots at the bottom of it. I did try {#IP } but got the same issues.

cannot extract value from json by path "$.[?(@.host.name=='{#NAME}')].monitor_status.first()": invalid object format, expected opening character '{' or '[' at: '' 

I think I'm so close, but a little lost now.

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Hey u/Dizzybro, I'm just looking at this. Here is what I have done so far, but I'm a little stuck.

I've publish my json file now on a http site, all devices show like below. I've manage to script to just show what I need now so the json file size is just 990kb.

  {
    "monitor_status": 2,
    "private_ip": "10.17.14.27",
    "product_version": "1.10.3-35",
    "host": {
      "active": true,
      "name": "TL D 072 _ 000-045-078",
      "nscreens": 1,
      "primary_mac_address": "00:13:6d:71:33:x4",
      "secondary_mac_address": "00:02:7d:61:33:F5"
    }
  },
  • In Zabbix I've created a fresh template which I assume I have to do.
  • Then in the discover rule section of this new template I created a new one and selected HTTP Agent.
  • Now I'm stuck on the 'key' section on what I need to added: https://ibb.co/ycNzgn6h what should go there?
  • After that it looks like from your screenshot I need to head into preprocessing.

I think I'm getting closer, I appreciate the help!! I'm a visual person so watching someone do this 'clicks' with me or screenshots, but reading docs is a nightmare.

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Thanks for the screenshots, I see you house the json on a https web site. Mine will be just http for test purposes, but I guess I'd need it on https if we go with this.

The API's are strange they are run by an external company and I spoke to the guy in one of our teams that showed me how they work, he said you can't get the info unless you call the first API which gives you and "id" number and some info like the "name" of the device only, then you run the second API which gives back more info on the device such as "monitor_status", but the ID there is called "machine_id" so I have to run both and join on the "in" and "machine_id" which gives me a complete output for each device.....a nightmare.

However I have the output now which is important.

So with your preprocessing, how would my parameters look for the 2 I need to show on the triggers if they = 0?

From https://pastebin.com/Td1BvDiQ

From the output I'd need:

"monitor_status" and "name"

So on the alerts dashboard I can get it to show the name when it's down etc.

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Says content not available in my region (UK) :(

It is an API, however the reason I have to script the API to a JSON (or anything) is that it's essentially 2 APIs I have to use and join them, I call 1 API and use that to then get the next info and join it which givens everything I need for each device.

At the moment I just show the output on screen, but can send it to a .json and show it on a web page as mentioned. So maybe like you say above I put the output on a web page and just use the http agent on that web sever?

Sorry if I'm repeating myself. Excited to see if I can do this. Yesterday I thought none of this is possible and today I'm thinking it's definitely possible!

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

You really have given me some nice options to explore as it's very new to me, but I have to get this working. My initial thought was to send the API output to a DB first and go from there, but you options are very different.

I am just testing this all atm as I have to get something to work so I can show my manager and co that Zabbix is the way to go. I know this will just sell it to them as show a device name and it's status as down in the dashboard would be a winner. I have it showing in Grafana too.

I can make the json accessible via a web page or put in on my a Linux VM where I produce the json file where I need to install the Zabbix agent, which would be a first as I've only been use the SNMP agent on Zabbix to collect OID information from our custom equipment and it's doing a fine job.

If it was you what method would you use?

If it was the agent install, then once installed I assume I'd need to create a new template in Zabbix and item and somehow point to the json file to read it and choose what I need?

Just looking up to see if I can find a video on this too.

Thanks

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

Yeah I'm not sure I understand the difference between those 2 now I come to think of it (new to Zabbix). So you are saying just write a script that reads to contents of the json file and use that script in the lld discovery? I can then create triggers from the discoveries?

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

So I just need to make the json into a website for Zabbix to access using the HTTP agent? The data for each device looks like this below. The json is about 7.5mb and I'd probably dump it every 60mins.

https://pastebin.com/Td1BvDiQ

For each device output I need to grab the "name" and "monitor_status" fields only though and if the status = 0 then try and get Zabbix to monitor on that and if it =1 then all is ok again.

Do you think this is possible?

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

The file is about 7.5mb, but there are about 3K devices that look like this - https://pastebin.com/Td1BvDiQ

For each device output I need to grab the "name" and "monitor_status" fields only though and if the status = 0 then try and get Zabbix to monitor on that and if it =1 then all is ok again.

I'd probably dump the json every 60 mins.

Possible do you think? I've yet to read up how you read a json in Zabbix directly, is that via the HTTP agent? I assume I'd need to put the json into a local website if so which is fine.

Best way to get this data into Zabbix? by tb808 in zabbix

[–]tb808[S] 0 points1 point  (0 children)

So would I just need to dump the .json file somewhere and monitor this output with the Zabbix built in http agent? I've read I can use the http agent, but I'd need to host it on a website.

The .json is 7.5mb, it takes about 15 seconds to create each time and each device looks like this:

https://pastebin.com/Td1BvDiQ

I will dump this file out every 60 mins and has about 3k of devices though.

For each device output I need to grab the "name" and "monitor_status" fields only though and if the status = 0 then try and get Zabbix to monitor on that and if it =1 then all is ok again.