Hello everyone,
I've been working on some automation on a tool i built myself and i'm running into a little issue. I use a webpage to create maintenance which in turns create the VM snapshot and the Zabbix maintenance. It all works but the host in Zabbix is not getting into maintenance mode.
My php page sends information to a python script which is making the API call. Here's that portion of script that is creating the maintenance :
When i look into Zabbix's database, my host is not update with the maintenance id and the tag ::
I tried updating the host through an SQL command, which works but when the maintenance is over, the host does not get updated back to the default value.
I'm under the impression that there's some underlining process that manages the host status for maintenance.
Any ideas ?
I've been working on some automation on a tool i built myself and i'm running into a little issue. I use a webpage to create maintenance which in turns create the VM snapshot and the Zabbix maintenance. It all works but the host in Zabbix is not getting into maintenance mode.
My php page sends information to a python script which is making the API call. Here's that portion of script that is creating the maintenance :
Code:
m = requests.post(ZABBIX_API_URL,json={
"jsonrpc": "2.0",
"method": "maintenance.create",
"params": {
"name": maintenance_name,
"active_since": int(active_since),
"active_till": active_till,
"tags_evaltype": 0,
"hostids": [f"{hostid}"],
"timeperiods": [
{
"start_time": int(active_since),
"period": period
}
]
},
"auth": AUTHTOKEN,
"id": 1
})
Code:
MariaDB [zabbixdb]> select * from hosts WHERE hostid=11856 \G
*************************** 1. row ***************************
hostid: 11856
proxy_hostid: NULL
host: CNQ-Linux2204
status: 0
disable_until: 0
error:
available: 0
errors_from: 0
lastaccess: 0
ipmi_authtype: -1
ipmi_privilege: 2
ipmi_username:
ipmi_password:
ipmi_disable_until: 0
ipmi_available: 0
snmp_disable_until: 0
snmp_available: 0
maintenanceid: NULL
maintenance_status: 0
maintenance_type: 0
maintenance_from: 0
I'm under the impression that there's some underlining process that manages the host status for maintenance.
Any ideas ?
Comment