Introducing SOC Insights for BloxOne Threat Defense: Boost your SOC efficiency with AI-driven insights to eliminate manual work and accelerate investigation and response times. Read the blog announcement here.

API & Integration, DevOps,NetOps,SecOps

Reply

Python Script for ADD Client

New Member
Posts: 2
3301     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

Adviser
Posts: 65
3301     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 ]
New Member
Posts: 2
3302     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

New Member
Posts: 5
3302     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

New Member
Posts: 1
3302     0

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

Showing results for 
Search instead for 
Did you mean: 

Recommended for You