From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

changing networksettings

Hi,

i have to change the networksettings (IP,Subnet,Dns...) from a python RESTAPI.

But i can`t find the configfile on the my 9068 with this settings.

where htis config file?

0 Kudos
Message 1 of 7
(4,109 Views)

I just wanted to check to make sure that I understand what you're asking fire: you are creating a RESTful server using Python REST API that allows remote RESTful clients can change the networking configuration of the server.

Is that about what your request is about?

0 Kudos
Message 2 of 7
(3,422 Views)

exactly!

0 Kudos
Message 3 of 7
(3,422 Views)

The way that would be insulated the best from future updates would be to use the System API C interface.

The interface is described here:http://zone.ni.com/reference/en-XX/help/373242G-01/nisyscfgcvi/ni_system_configuration/

I would then use the ctypes module to work with the .so on the target.

0 Kudos
Message 4 of 7
(3,422 Views)

Details on the ctypes Python functionality can be found here:https://docs.python.org/2/library/ctypes.html#module-ctypes

0 Kudos
Message 5 of 7
(3,422 Views)

Hi, i use this command`s now:

- /usr/local/natinst/bin/nirtcfg  --print0 --get section=SYSTEMSETTINGS,token=host_name

- /usr/local/natinst/bin/nirtcfg  --print0 --set section=SYSTEMSETTINGS,token=host_name,value=My9068

and it works fine

Message 6 of 7
(3,422 Views)

Yes, that is a reasonable approach, but as NI doesn't document that as a programmatic interface, it is subject to change in future releases.

Message 7 of 7
(3,422 Views)