Reply

Python Script for ADD Client

jhendersion
Techie
Posts: 2
215     0

I have been doing this manuly for 1 year and think it is time to automate this if possible. 

I log in go to

Data Management click on DHCP I type in the network in go to 10.xx.xx.0 

then click on the subnet in the range I want to add a host.

click on fixed address then add the mac address and last octect.

 

How can I find a python script to help 

 

Re: Python Script for ADD Client

Ingmar Community Manager
Community Manager
Posts: 58
216     0

 

This requires the requests module to be installed and for you to generate the auth token.

 

 

It will create a host record for test6.example.com in the default view based on the next available IP in 192.168.0.0/23 and with the mac dafedeadbeef

 

import requests

url = "https://yourGM/wapi/v2.10/record:host"

payload = "{\"name\": \"test6.example.com\",\"view\": \"default\",\"ipv4addrs\": [{\"ipv4addr\":\"func:nextavailableip:192.168.0.0/23\",\"mac\":\"dafedeadbeef\"}]}"
headers = {
    'Content-Type': "application/json",
    'Authorization': "Basic AUTHGOESHERE",
    }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

Re: Python Script for ADD Client

[ Edited ]
jhendersion
Techie
Posts: 2
216     0

thank you so I need requests module installed on infoblox in order to expect python scripts. How do I check if a request module was installed

 

I need mac addres to take a specific ip address

 

Re: Python Script for ADD Client

icristerna
Techie
Posts: 1
216     0

add import requests at the beginning of your script. If you get no errors about that, the module is installed and usable.

 

Simplistic but, IMHO, effective way to check.

 

Thank you.

Re: Python Script for ADD Client

brashetreysha
Techie
Posts: 2
216     0

If you get no sudoku aadhar card Onlinesbi errors about that, the module is installed and usable.

Showing results for 
Search instead for 
Do you mean 

Recommended for You