I am trying to use a zencommand that is akin to the check_http
command against several of our servers, the problem is that the IP
address that I have to have the test sent to is not the managed IP
address.
My question is how can I use a TALES expression to say always use
the IP address on bond0.10. All of the servers show the bond under
the OS tab, so Zenoss knows it is there, I just cannot find out how
to access this interface via TALES.
You can't do any looping or list comprehensions within TALES
statements, so this is impossible within the current command template.
Jason Stevens has proposed an enhancement (http://dev.zenoss.org/trac/ticket/2238
) that will allow usage of python expressions within the command
templates. This will allow you do do what you want. Until that time
you can work around it by adding a method to your OperatingSystem
class ($ZENHOME/Products/ZenModel/OperatingSystem.py).
def bond010InterfaceIp(self):
try:
bond010 = self.interfaces._getOb('bond0.10')
return bond010.getIp()
except AttributeError:
return {'getIp':self.device().manageIp}
Then you could use ${here/os/bond010InterfaceIp} in your command
template.
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users