1. Curl关闭Nagios监控通知
Disable notifications for this host(cmd_typ=25)
curl --silent --show-error --data cmd_typ=25 --data cmd_mod=2 --data host=10_10_105_146 --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
enable notifications for this host(cmd_typ=24)
curl --silent --show-error --data cmd_typ=24 --data cmd_mod=2 --data host=10_10_105_146 --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
Disable Notifications For All Services On This Host(cmd_typ=29)
curl --silent --show-error --data cmd_typ=29 --data cmd_mod=2 --data host=10_10_105_146 --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
Enable Notifications For All Services On This Host(cmd_typ=28)
curl --silent --show-error --data cmd_typ=28 --data cmd_mod=2 --data host=10_10_105_146 --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
Disable Checks Of All Services On This Host(cmd_typ=16)
curl --silent --show-error --data cmd_typ=16 --data cmd_mod=2 --data host=10_10_105_146 --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
Enable Checks Of All Services On This Host(cmd_typ=15)
curl --silent --show-error --data cmd_typ=15 --data cmd_mod=2 --data host=10_10_105_146 --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
Disable notifications for this service(cmd_typ=23)
curl --silent --show-error --data cmd_typ=23 --data cmd_mod=2 --data host=10_10_105_146 --data service=check_disk_/ --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
Enable notifications for this service(cmd_typ=22)
curl --silent --show-error --data cmd_typ=22 --data cmd_mod=2 --data host=10_10_105_146 --data service=check_disk_/ --data btnSubmit=Commit --insecure http://nagiosserver/nagios/cgi-bin/cmd.cgi -u “nagiosadmin:password”
2.关闭zabbix监控通知
1.获取token
curl -s -X POST -H ‘Content-Type:application/json’ -d ‘{
“jsonrpc” : “2.0”,
“method” : “user.login”,
“params” : {
“user” : “username”,
“password” : “password”
},
“id” : 1
}’ http://zabbixserver/zabbix/api_jsonrpc.php
2.获取主机ID
curl -s -X POST -H ‘Content-Type:application/json’ -d ‘{
“jsonrpc”: “2.0”,
“method”: “host.get”,
“params”: {
“output”: “extend”,
“filter”: {
“host”: [
“Zabbix server”,
“10.10.105.146”
]
}
},
“auth”: “token”,
“id”: 1
}’ http://zabbixserver/zabbix/api_jsonrpc.php
3.关闭主机监控状态
curl -s -X POST -H ‘Content-Type:application/json’ -d ‘{
“jsonrpc”: “2.0”,
“method”: “host.update”,
“params”: {
“hostid”: “10340”,
“status”: 1
},
“auth”: “token”,
“id”: 1
}’ http://zabbixserver/zabbix/api_jsonrpc.php




