TECHZEN Zenoss User Community ARCHIVE  

Query db for server status

Subject: Query db for server status
Author: Eamon
Posted: 2019-01-23 08:36

Hi,
 
I'm using Zenoss 4.2.4. I was wondering is there a DB schema legend for Zenoss. Basically what I want to do is have an sql query run everyday of the production state of the servers. Then I'm going to send that to a text file and compare it with what the production state of the servers should be. Then I'll configure this script to send an email. 
The part I'm struggling with is finding the production state of the server in the database, I see object state but the values are bigint and longblob. I'm pretty sure these are not correct and the info should be held as a string. 
Any help would be appreciated. 

Éamon

------------------------------
Eamon
------------------------------


Subject: RE: Query db for server status
Author: Ryan Matte
Posted: 2019-02-21 11:28

You're not going to be able to do what you're asking because Zenoss stores it's data in a database called zodb, and then we use something called relstorage to store that zodb inside of MySQL (to improve performance).  It stores that data as binary blobs and you'll never be able to make sense of it by issuing direct MySQL queries.  You'll either need to write a zendmd script to pull out the data that you're wanting (there are tons of examples of doing this online) or make use of the official Zenoss API to fetch that data.

http://wiki.zenoss.org/Category:Tips (see the ZenDMD Tips)

http://wiki.zenoss.org/Working_with_the_JSON_API



------------------------------
Ryan Matte
------------------------------


< Previous
Unable to add a Hub or Collector
  Next
Controlling ping cycle in Zenoss 5 / 6
>