TECHZEN Zenoss User Community ARCHIVE  

Monitoring templates, commands in Zenoss 6

Subject: Monitoring templates, commands in Zenoss 6
Author: Jad Baz
Posted: 2018-11-08 11:26

Hello,

I'm using Zenoss 4 and I rely heavily on commands and monitoring templates.

I don't have direct communication with my devices. Instead:
The way this affects my usage of Zenoss is:

Both of the above will not work in Zenoss 6 out of the box for the following reasons:

Any suggestions for how I can do this?

Here's what I've come up with so far, it's kinda ugly though:


------------------------------
Jad
------------------------------


Subject: RE: Monitoring templates, commands in Zenoss 6
Author: Jason Olson
Posted: 2018-11-08 11:58

For commands, can you define them as a user command? Rather than run them as a shell script on the host, can you run them within Zenoss itself by defining them in Advanced -> Commands -> Define Commands?

------------------------------
Jason Olson
------------------------------


Subject: RE: Monitoring templates, commands in Zenoss 6
Author: Jad Baz
Posted: 2018-11-09 04:16

Thanks but this is what I'm currently doing.

I have Zenoss commands. They invoke a shell script on the host. Something like:
sh issue_command.sh ${device/id} <command_name>

This shell script in turn inserts a record in a mysql db (this table holds which devices have an upcoming command to run). The actual running of the command is completely outside Zenoss and is very custom.

In any case, this is custom business logic and is not going to change.

If possible, please re-read the question with this in mind.

Thank you

------------------------------
Jad
------------------------------


Subject: RE: Monitoring templates, commands in Zenoss 6
Author: Jane Curry
Posted: 2018-11-09 05:39

So, I think you are saying that your extra mysql database is on your "local" Zenoss 4 server, along with the commands that communicate with the target devices?

It's clunky but can you create some ssh scripts in the zencommand container that uses ssh to drive the existing scripts on the base Zenoss system?  That way, at least you leave your existing mechanism unchanged on the base box.  Importing stuff into a container, updating it, protecting it from Zenoss 6 updates, etc may be a big pain.  Effectively, you just treat the base box as a "remote" target.

Do you know that anything in a container under /var/zenoss is "DFS" storage and appears on the base box under /opt/serviced/var/volumes/<tenant-id>/var-zenpacks - I use this to hold stuff that I need accessible by all containers and the base.

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


Subject: RE: Monitoring templates, commands in Zenoss 6
Author: Jad Baz
Posted: 2018-11-09 06:46

Oh wow, sounds great.
Thanks Jane.

I guess this could work similarly for monitoring templates, right?
I could do:
ssh -t user@domain 'check_mysql_query ...'

Another question here is: I'll be going from one environment to another (dev, stage, prod) where "domain" changes, along with the "user" as well.
I wouldn't want to rename these commands every time. 

Is there a way to store and use variables like these as global variables somewhere?

------------------------------
Jad
------------------------------


Subject: RE: Monitoring templates, commands in Zenoss 6
Author: Jane Curry
Posted: 2018-11-10 09:25

Uou might look at the concept of cProperties (custom properties).  They work just like zProperties but you can create them through the GUI - you don't need to write a ZenPack.  You create them at a device class level from DETAILS -> Custom Schema and can set a default value at the class level but you can override for an individual device.  So you might create a cDomain cProperty...

Cheers,
Jane

------------------------------
Jane Curry
Skills 1st United Kingdom
jane.curry@skills-1st.co.uk
------------------------------


< Previous
Intermittent - Server not found in Kerberos database
  Next
zenping and device polling frequency
>