NB3000-Line-Hd User Manual 4.2
Let’s now pay some attention to the very powerful API function
nb_status
. It can be used
to query the router’s status values in the same manner as they can be shown with the CLI.
It returns a structure of variables for a specific section (a list of available sections can be
obtained by running
cli status -h
).
By using the
dump
function you can figure out the content of the returned structure:
/* dump current location */
dump ( nb_status (
" location "
));
The script will then generate lines like maybe these:
struct(8): {
.LOCATION_STREET
= string[11]: "Bahnhofquai"
.LOCATION_CITY
= string[10]: "Zurich"
.LOCATION_COUNTRY_CODE = string[2]: "ch"
.LOCATION_COUNTRY
= string[11]: "Switzerland"
.LOCATION_POSTCODE
= string[4]: "8001"
.LOCATION_STATE
= string[6]: "Zurich"
.LOCATION_LATITUDE
= string[9]: "47.3778058"
.LOCATION_LONGITUDE
= string[8]: "8.5412757"
}
In combination with the
nb_config_set
function, it is possible to start a re-configuration of
any parts of the system upon status changes. You may query possible sections and param-
eters again with the CLI:
~ $ cli get -c wanlink.0
cli get -c wanlink.0
Showing configuration entities (matching ’wanlink.0’):
wanlink.0.mode
wanlink.0.multipath
wanlink.0.name
wanlink.0.options
wanlink.0.passthru
wanlink.0.prio
wanlink.0.suspend
wanlink.0.switchback
wanlink.0.weight
Running the CLI in interactive mode, you will be also able to step through possible configu-
ration parameters by the help of the
TAB
key.
117
Содержание NB3000-Line-Hd
Страница 15: ...3 Speci cations 3 1 Appearance 6...
Страница 106: ...NB3000 Line Hd User Manual 4 2 5 6 VPN 5 6 1 OpenVPN OpenVPN Administration Figure 5 28 OpenVPN Administration 97...
Страница 186: ...NB3000 Line Hd User Manual 4 2 5 9 LOGOUT Please use this menu to log out from the Web Manager 177...