[ZBX-3510] Unable to full clone template with discovery Created: 2011 Feb 04  Updated: 2017 May 30  Resolved: 2011 Nov 11

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Frontend (F)
Affects Version/s: 1.9.2 (alpha)
Fix Version/s: 2.0.0

Type: Incident report Priority: Blocker
Reporter: Evan James Anderson Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: discovery, lld, templates
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

fedora 13 mysql 5.1.5


Attachments: PNG File error_cloning_host_with_graph.png     PNG File error_cloning_host_with_graph2.png    

 Description   

I was trying to duplicate a template and found that the discovery items/trigger/graphs do not come with.
Work around for now is to manually create discovery items/trigger/graphs on the new template.



 Comments   
Comment by Aleksandrs Saveljevs [ 2011 Feb 15 ]

Raising the priority to critical. This is not a minor bug.

Comment by Pavels Jelisejevs (Inactive) [ 2011 Nov 01 ]

RESOLVED.

Comment by Alexey Fukalov [ 2011 Nov 01 ]

(1) [GUI]
Try to full clone host with one discovery rule and one prototype, discovery rule that is created in the template linked to this host . Get error: Item uses host interface from non-parent host. [CDiscoveryRule.copy -> CDiscoveryRule.copyDiscoveryRule -> CDiscoveryRule.create -> CDiscoveryRule.checkInput -> CItemGeneral.checkInput]

<pavels> RESOLVED.

<igor> Got the following error when using dev branch ZBX-3510 (rev 22894) and trying to full clone host which has discovery rule with item prototype, trigger prototype:

Discovery rule [LLD_host3:vfs.fs.discovery] created
Item prototype [LLD_host3:vfs.fs.size[

{#FSNAME}, pfree]] created
Trigger [Low free disk space on {HOSTNAME} volume {#FSNAME}

:{LLD_host3:vfs.fs.size[

{#FSNAME}

, pfree].last(0)}<50] created.
Host with item [vfs.fs.discovery] already exists [CDiscoveryRule.copy -> CDiscoveryRule.copyDiscoveryRule -> CDiscoveryRule.create -> CDiscoveryRule.createReal]

But when discovery rule is created in the host conf then can perform full clone of that host.

<pavels> Yup, there was a problem when a discovery rule was inherited from a template. RESOLVED.

<Igor> TESTED

Vedmak <CLOSED>

Comment by Alexey Fukalov [ 2011 Nov 01 ]

(2) [GUI]
In file class.citem.php you added option "selectItemDiscoveries" it does not do anything.

<pavels> RESOLVED.

<Vedmak> CLOSED

Comment by Alexey Fukalov [ 2011 Nov 01 ]

(3) [GUI]
In file templates.php graphs copying logic was replaced with discovery rules logic.

<pavels> RESOLVED.

<Vedmak> CLOSED

Comment by Alexey Fukalov [ 2011 Nov 01 ]

(4) [GUI]
In api calls option "'select' => API_OUTPUT_EXTEND," is used often. but we don't have such option in api. Also we place open curly bracket on same line with function definition, separated by space.

<pavels> Fixed. RESOLVED.

<Vedmak> CLOSED

Comment by Alexey Fukalov [ 2011 Nov 01 ]

(5) [GUI]
Maybe we could rename 'discoveryruleids' option to 'discoveryids' for copy method, to be consistent with other api methods?

<pavels> RESOLVED.

<Vedmak> CLOSED

Comment by Alexey Fukalov [ 2011 Nov 01 ]

(6) [GUI]
In DiscoveryRule class method isReadable has api cal with two identical options 'itemids'. Also maybe we could add method isWritable to this class too, for consistancy.

<pavels> Good idea. RESOLVED.

<Vedmak> CLOSED

Comment by Alexey Fukalov [ 2011 Nov 01 ]

(7) [GUI]
In method copyDiscoveryRule we create interfaces "if ($srcDiscovery['flags'] != ZBX_FLAG_DISCOVERY) {" this shouldn't ever be true, because DiscoveryRule->get returns only discovery rules with correct lag, and anyway we should not create any interfaces when we copy things. If there is no interface for item/discovery rule, we throw error.

<pavels> RESOLVED.

<Vedmak> CLOSED

Comment by Igor Danoshaites (Inactive) [ 2011 Nov 02 ]

(8) When trying to full clone host with graph in the LLD rule, after clicking "Save" button appears the following error:

Value "'Can\'t create graph [lld_graph]: graph already exists\nCan\'t create graph [lld_graph]: graph already exists\nCan\'t create graph [ll'" is too long for field "error" - 133 characters. Allowed length is 128 characters. [CDiscoveryRule.copy -> CDiscoveryRule.copyDiscoveryRule -> CDiscoveryRule.create -> CDiscoveryRule.createReal -> DB.insert -> DB.checkValueTypes]

Checked- graph with such name does not exist in this Zabbix DB.

Please also notice that error message is repeated 3 time, but in the end it is cutted, as allopwed length for the error filed is 128 characters.
For more details please also see my attached screen shots.

<pavels> RESOLVED

<igor> TESTED

<Vedmak> CLOSED

Comment by Igor Danoshaites (Inactive) [ 2011 Nov 02 ]

(9) Please also pay attention to the fact that tool tip will not disappear (will still appear on the screen) after clicking on the "Close" record inside this tool tip

<pavels> This may be a bit tricky to fix, so I've opened a separate issue for it: ZBX-4315.

<Igor> CLOSED, I misunderstood it. Please also close ZBX-4315.

<pavels> Why? There really is a problem with the tooltips in Chrome and FF.

<igor> TESTED, now in FF and chrome browsers link on "Close" record is also working

<Vedmak> CLOSED

Comment by Igor Danoshaites (Inactive) [ 2011 Nov 03 ]

(10) When full clone template with discovery rule in it, as result in the frontend will be created new template, but in the "Details" for the info message
"New template added" appears the following info:

Discovery rule [Template_LLD2:vfs.fs.discovery] created
Item prototype [Template_LLD2:vfs.fs.size[

{#FSNAME}, pfree]] created
Trigger [Low free disk space on {HOSTNAME} volume {#FSNAME}

:{Template_LLD2:vfs.fs.size[

{#FSNAME}, pfree].last(0)}<50] created.

but should be "Trigger prototype [Low free disk space on {HOSTNAME} volume {#FSNAME}

:{Template_LLD2:vfs.fs.size[

{#FSNAME}, pfree].last(0)}<50] created." instead
of "Trigger [Low free disk space on {HOSTNAME} volume {#FSNAME}

:{Template_LLD2:vfs.fs.size[

{#FSNAME}

, pfree].last(0)}<50] created."
(word prototype is missing)

<pavels> RESOLVED.

<igor> TESTED

<Vedmak> CLOSED

Comment by Igor Danoshaites (Inactive) [ 2011 Nov 03 ]

(11) Similar to (10):

When full clone host with discovery rule in it, in the "Details" will be shown the following info:

Discovery rule [LLD_host2_clone:vfs.fs.discovery] created
Item prototype [LLD_host2_clone:vfs.fs.size[

{#FSNAME}, pfree]] created
Trigger [Low free disk space on {HOSTNAME} volume {#FSNAME}

:{LLD_host2_clone:vfs.fs.size[

{#FSNAME}

, pfree].last(0)}<50] created.

Please note that there should be "Trigger prototype ... created", but not "Trigger ... created"

<pavels> RESOLVED.

<Igor> TESTED

<Vedmak> CLOSED

Comment by Alexey Fukalov [ 2011 Nov 11 ]

(12) [GUI]
In class.cdiscoveryrule.php:1026 variable $srcItem is undefined.

<pavels> RESOLVED.

<Vedmak> CLOSED

Comment by Pavels Jelisejevs (Inactive) [ 2011 Nov 11 ]

CLOSED.

Generated at Sat Apr 20 15:43:24 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.