From 5a45dd85697175b04f305567a8231c5b0a3a4d47 Mon Sep 17 00:00:00 2001 From: Patrick Wagner Date: Fri, 9 May 2025 20:27:35 +0200 Subject: [PATCH] Update README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 732c665..0514fff 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,21 @@ An ugly simple script that updates the API bearer token for HTTP Agent checks # Notes. I know there are many other ways to script this prettier, I am just lazy. + +# How to + +Create a python script that: + +reqs: pyzabbix (pip install pyzabbix), json, requests, logging + +1- Get the bearer from your web/api endpoint using 'requests' python package. +2- create a function to update the item by: + +zapi = ZabbixAPI("https://127.0.0.1") +zapi.login("","zabbix api password") + +jsontoken = { +'Authorization': 'Bearer '+ token +} +zapi.item.update(itemid='', headers=jsontoken) +