[ZBX-21169] I can't create an action via zabbix api in version 6.0.4 Created: 2022 Jun 04 Updated: 2022 Jun 06 Resolved: 2022 Jun 06 |
|
| Status: | Closed |
| Project: | ZABBIX BUGS AND ISSUES |
| Component/s: | None |
| Affects Version/s: | 6.0.4 |
| Fix Version/s: | None |
| Type: | Problem report | Priority: | Trivial |
| Reporter: | Ricardo Barbosa Dias | Assignee: | Vladimir Stepanov (Inactive) |
| Resolution: | Won't fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Zabbix version: 6.0.4 |
||
| Attachments: |
|
| Description |
|
Steps to reproduce:
#!/usr/bin/env bash URL='http://192.168.11.95/zabbix/api_jsonrpc.php' HEADER='Content-Type:application/json' USER='"Admin"' PASS='"zabbix"' authentication() { JSON=' { "jsonrpc": "2.0", "method": "user.login", "params": { "user": '$USER', "password": '$PASS' }, "id": 0 } ' curl -s -X POST -H "$HEADER" -d "$JSON" "$URL" | cut -d '"' -f8 } TOKEN=$(authentication) createAction() { JSON=' { "jsonrpc": "2.0", "method": "action.create", "params": { "name": "Information", "eventsource": 0, "status": 0, "esc_period": "2m", "filter": { "evaltype": 0, "conditions": [ { "conditiontype": 4, "operator": 0, "value": 1 } ] }, "operations": [ { "operationtype": 0, "esc_period": "1m", "esc_step_from": 1, "esc_step_to": 1, "evaltype": 0, "opmessage_usr": [ { "userid": "2" } ], "opmessage": { "default_msg": 1, "mediatypeid": "9", "message": "OI", "subject": "test" }, "opconditions": [ { "conditiontype": 14, "operator": 0, "value": "0" } ] } ] }, "auth": "'$TOKEN'", "id": 1 } ' curl -s -X POST -H "$HEADER" -d "$JSON" "$URL" } createAticion
But it's not work. The follow message is exhibit.
$ bash default.sh ,"id":1} Let me know if i'm something doing wrong. Result: |
| Comments |
| Comment by tsuno teppei [ 2022 Jun 06 ] |
|
Since version 6.0, opmessage_user / opmessage_grp / mediatypeid in opmessage is an error for String. |
| Comment by Vladimir Stepanov (Inactive) [ 2022 Jun 06 ] |
|
Hi, If you like to use your custom subject, so you have to set default_msg=0 |