-
Type:
Problem report
-
Resolution: Unresolved
-
Priority:
Major
-
Affects Version/s: 6.0.49, 7.0.32, 7.4.16, 8.0.0
-
Component/s: API (A)
-
Sprint candidates
Environment
- Zabbix server and frontend 8.0.0 (tag "8.0.0", commit "c81e276e505924eaa115d0aa4bb81c388233f924")
Steps to reproduce
- Create host groups "Hypervisors", "Virtual machines" and "Customers".
- Create template "Template VM status" with item "VM status" (type "Zabbix trapper", key "vm.status", type of information "Numeric (unsigned)") and trigger "VM status problem" with expression "last(/Template VM status/vm.status)>0".
- Create template "Template VM discovery" with discovery rule "VM discovery" (type "Zabbix trapper", key "vm.discovery").
- In this discovery rule create host prototype "{#VM}" with host group "Virtual machines", group prototypes "VM {#VM}" and "Customers/{#VM}", and template "Template VM status".
- Create host "host1" in group "Hypervisors" and link template "Template VM discovery".
- Create user group "Operators 1" without permissions and user group "Operators 2" with Read on "Customers".
- Create users "user1" (group "Operators 1") and "user2" (group "Operators 2"), both with role "User role" and media type "Email".
- Create trigger action "Notify operators" that sends a message to "user1" and "user2".
- Send discovery data (block 1). Host "vm1" is created in groups "Virtual machines", "VM vm1" and "Customers/vm1". "Operators 2" gets Read on "Customers/vm1" from "Customers".
- In "Operators 1" add Read on "VM vm1".
- Log in as "user1" and as "user2" and open Monitoring → Hosts. Both see "vm1".
- Create a problem on "vm1" (block 2) and check alerts of this problem in Reports → Action log.
- As "Admin" open Data collection → Hosts → "host1", click Unlink next to "Template VM discovery" and click Update.
- Check host "vm1", its host groups, permissions of "Operators 1" and "Operators 2", and Monitoring → Hosts as "user1" and "user2".
- Create a new problem on "vm1" (block 2) and check alerts again.
- Send discovery data again (block 1) and check Monitoring → Hosts as "user1" and "user2".
1. Discovery data
zabbix_sender -z 127.0.0.1 -s host1 -k vm.discovery -o '[{"{#VM}":"vm1"}]'
2. Problem on vm1
zabbix_sender -z 127.0.0.1 -s vm1 -k vm.status -o 0 zabbix_sender -z 127.0.0.1 -s vm1 -k vm.status -o 1
Result
Frontend shows "Host updated". After Unlink:
- Host "vm1" still exists, but only in group "Virtual machines".
- Host groups "VM vm1" and "Customers/vm1" are deleted. Audit log shows "Delete" for both host groups by "Admin".
- "Operators 1" has no permissions any more. "Operators 2" keeps only Read on "Customers". Audit log has no record for these user group changes.
- Monitoring → Hosts shows "No data found" for "user1" and for "user2".
- New problem on "vm1" is created, but there are no alerts for "user1" and "user2" and no error.
After next discovery run both groups are created again as new host groups. "Operators 2" gets Read on new "Customers/vm1" from "Customers", so "user2" sees "vm1" again. "Operators 1" stays without permissions, so "user1" still sees "No data found".
| Check | Result |
|---|---|
| Host "vm1" after Unlink (3 runs) | exists, only in "Virtual machines" |
| Host groups "VM vm1" and "Customers/vm1" after Unlink (3 runs) | deleted |
| Read of "Operators 1" on "VM vm1" after Unlink (3 runs) | removed, no audit record |
| Monitoring → Hosts as "user1" and "user2" after Unlink (3 runs) | "No data found" |
| Alerts to "user1" and "user2" for new problem, before Unlink (2 runs) | one alert for each user |
| Alerts to "user1" and "user2" for new problem, after Unlink (2 runs) | no alerts, no error |
| Monitoring → Hosts after next discovery run (2 runs) | "user1": "No data found"; "user2": "vm1" visible |
Expected
Unlink keeps discovered host groups and their permissions, as it keeps other entities. Linking/unlinking: "Choosing the Unlink option will simply remove association with the template, while leaving all its entities with the host. This includes items, triggers, graphs, low-level discovery rules, and web scenarios, but excludes dashboards."