On May 9, 2008, at 3:54 AM, gentux31 wrote:
Whenever a bgp peering goes down I want to do a nslookup for that IP.

Can I do something like this in the event transform:

import os
evt.summary = os.system('nslookup evt.bgppeer_ip')

I'd recommend sticking with Python rather than forking off a shell and nslookup.

from socket import gethostbyaddr
try:
    evt.bgppeer_name = gethostbyaddr(evt.bgppeer_ip)[0]
except:
    pass

The forum will remove the four space before the evt.bgppeer_name and pass lines. You do need them.

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to