Closed lep1986 closed 6 years ago
Hello @lep1986 ,
Zabbix API dont support disabling hosts with a comment. But if you want disable the host and add a description with reason for disabling, this is already supported using this module:
import-module power-zabbix;
# authenticates
Auth-Zabbix -Url http://myzabbix/zabbix
# Get a sample host for disable...
#We want retrieve just properties status and description. Just it will be updated
$MyHost = Get-ZabbixHost -Name "MyHost" -output "status","description"
# Update the status of it (1 = disabled)
# https://www.zabbix.com/documentation/3.0/manual/api/reference/host/object
$MyHost.status = 1
#Updates the description fiedl!
#Add a line break and some text!
$MyHost.description += "`nDisabled due some reason"
#Updates the host on server
$MyHost | Update-ZabbixHost
WOW! You're unbelievable! Amazing! Thank you!
Nice work! Can you add disable, enable host with comment ?