TECHZEN Zenoss User Community ARCHIVE  

Does anyone know how I can see all file system thresholds I've overridden?

Subject: Does anyone know how I can see all file system thresholds I've overridden?
Author: [Not Specified]
Posted: 2015-08-04 14:50

Hello,
I am running Zenoss 4.2.5. I'm setting up a new Zenoss 5 instance. Since the data cannot be migrated from 4 to 5 yet I need to duplicate the file system utilization thresholds I've adjusted in the old instance. However, I'm not sure how to see what they are unless I open every drive on every system.... Any suggestions Is there a way I can generate a report of all systems with overridden templates, with whats been overrridden/changed

Thanks!



Subject: There's not going to be a
Author: Andrew Kirch
Posted: 2015-08-11 09:25

There's not going to be a quick easy way to do this. I'd suggest taking a backup of the database, and poking around. You should be able to at least export a list of overrides. Note that we do have an export/import tool coming to help migrate this sort of data to 5.x so answer #2 might be "wait a few months".

Thanks!

Andrew Kirch

akirch@gvit.com

Need Zenoss support, consulting or custom development Look no further. Email or PM me!

Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard



Subject: API can get this stuff, by brute-force
Author: [Not Specified]
Posted: 2015-08-11 09:47

A brute force method that might be useful using the JSON API. If you've never used it, start here:
http://wiki.zenoss.org/Working_with_the_JSON_API

For each device you could use the getComponents method to retrieve the uids of your filesystems.

zenoss_api device_router DeviceRouter getComponents '{"uid":"/zport/dmd/Devices/Storage/NetApp/devices/NETAPP2","meta_type":["fileSystem"],"keys":["uid"]}'

You get a list back, looks like this:

'uid' => '/zport/dmd/Devices/Storage/NetApp/devices/NETAPP2/os/filesystems/RES_LUN02_vol'
'uid' => '/zport/dmd/Devices/Storage/NetApp/devices/NETAPP2/os/filesystems/RES_LUN03_vol'

Then for each of those get the template that it is bound to:

zenoss_api template_router TemplateRouter getObjTemplates '{"uid":"/zport/dmd/Devices/Storage/NetApp/devices/NETAPP2/os/filesystems/RES_LUN02_vol"}'|grep uid

'uid' => '/zport/dmd/Devices/Storage/NetApp/devices/NETAPP2/os/filesystems/RES_LUN02_vol/FileSystem',

zenoss_api template_router TemplateRouter getObjTemplates '{"uid":"/zport/dmd/Devices/Storage/NetApp/devices/NETAPP2/os/filesystems/RES_LUN03_vol"}'|grep uid

'uid' => '/zport/dmd/Devices/Storage/NetApp/rrdTemplates/FileSystem',

You can see that one of them is a template that is local to the device and one of them belongs to the class.

Hope this helps

Dave



Subject: By the way, the wiki has a
Author: [Not Specified]
Posted: 2015-08-12 08:43

By the way, the wiki has a zendmd method for identifying devices with local device templates:
http://wiki.zenoss.org/Print_a_List_of_Devices_with_Locally_Defined_Temp...

But that doesn't handle component templates.



Subject: Ah. here we go
Author: [Not Specified]
Posted: 2015-08-12 09:55

run in zendmd:

for dev in dmd.Devices.getSubDevices():
for fs in dev.os.filesystems():
for tpl in fs.getRRDTemplates():
tplpath=tpl.getRRDPath()
if tplpath.find(dev.id) >= 0:
print "%s %s %s" % (dev.id, fs.id, tplpath)

Since most filesystems' templates will be the default template for the class (probably /Device/Server), this prints out ones that have a template specific to the object (based on pattern matching device.id in the path of the template).

Edited to add: properly formatted code added to the wiki here
http://wiki.zenoss.org/Print_a_List_of_Devices_with_Locally_Defined_Temp...



Subject: Thanks! I really appreciate
Author: [Not Specified]
Posted: 2015-08-14 13:20

Thanks! I really appreciate this.



< Previous
Zenoss 5 ZenPing Issue
  Next
Relationship Issue
>