def add_device(device=None, device_class=None, collector='localhost', prod_state=1000):
 if (not device):
  device = __salt__['grains.get']('fqdn')
 if (not device_class):
  device_class = _determine_device_class()
 log.info('Adding device %s to zenoss', device)
 data = dict(deviceName=device, deviceClass=device_class, model=True, collector=collector, productionState=prod_state)
 response = _router_request('DeviceRouter', 'addDevice', data=[data])
 return response

def add_device ( device = None , device_class = None , collector = 'localhost' , prod_state = 1000 ) : if ( not device ) : device = __salt__ [ 'grains.get' ] ( 'fqdn' ) if ( not device_class ) : device_class = _determine_device_class ( ) log . info ( 'Adding device %s to zenoss' , device ) data = dict ( deviceName = device , deviceClass = device_class , model = True , collector = collector , productionState = prod_state ) response = _router_request ( 'DeviceRouter' , 'addDevice' , data = [ data ] ) return response
a function to connect to a zenoss server and add a new device entry .