We have been playing around with different ideas on how to link Site
Nagvis Maps to Site hostgroups and I have stumbled across something that
almost does what I am looking for.
We currently use the management url feature of a host template to create
dummy sitemap hosts to link to the correct nagvis map but knowing to
click on the managed by link of the sitemap host isn't very intuitive.
One of my co-workers said it would be really cool if we just added a new
menu item on the arrow submenu in the hostgroup hierarchy area.
I haven't really tried to learn the catalyst web framework before but
quickly found when the hostgroup menu items were populated so I started
playing with it a bit.
The following is the modified hostgroup menu page with a new "Map for"
option that would try to link to a nagvis map with the hostgroup name.
It works only if your map and hostgroup name are the same..
[%
PROCESS object_info_base;
opsview_hostgroup = c.model("OpsviewDB::Hostgroup").retrieve(object.id);
'<a href="'; c.uri_for(object.id, "detail"); '" class="action">Detail
for '; object.name; '</a><br />';
'<a href="/nagvis/nagvis/index.php?map=';object.name; '"
class="action">Map for '; object.name; '</a><br />';
IF object.can_be_changed_by(c.user);
'<a href="'; c.uri_for(object.id, "downtime"); '"
class="action">Schedule downtime</a><br />';
END;
info_status(opsview_hostgroup);
%]
My question is can I conditionally display the menu item based on the
existence of the map?
I could either scan the nagvis maps on the filesystem or build a table
of maps but I wasn't sure what my options were with the opsview
framework.
I appreciate any ideas or help you all may provide.
James Whittington
VC3, Inc.
_______________________________________________
Opsview-users mailing list
[email protected]
http://lists.opsview.org/lists/listinfo/opsview-users