Console
For the configuration and control of the device, there is a set of commands with parameters that can be entered through a console. The console is available via SSH or Telnet, or for devices with RS232 port through using a serial terminal. It is not necessary to use Telnet, in Raw Mode a simple TCP/IP connection is sufficient to send commands. The communication can also be performed automated (e.g. via scripting languages). The console features are configured through the web interface .
Login
A ssh / telnet log in can be configured with password or without:
Command Set
There are several command levels. The following commands are usable from each level:
|- bgcolor="#C1DDFB" |align="left"|back |align="left"|go back one level |- |- bgcolor="#C1DDFB" |align="left"|help |align="left"|all commands of the actual level |- |- bgcolor="#C1DDFB" |align="left"|help all |align="left"|show all commands |- |- bgcolor="#C1DDFB" |align="left"|logout |align="left"|logout (only when login required) |- |- bgcolor="#C1DDFB" |align="left"|quit |align="left"|quit console |- |}
The "help" command returns all the commands of the current level. If "help" is called from the top level, e.g. the line "http [subtopics]" appears. This means that there is another level for "http". With the command "http help" all commands below "http" are shown. Alternatively, with entering "http" you can select the http level, and "help" shows all the commands on the selected level. The command "back" again selects the top level. It is possible to use "help" at any position: "http passwd help" provides all commands that have the prefix "http passwd". You will find a complete list of all possible device commands in the chapter "Cmd Overview".
Parameter
If parameters are expected for the command, the parameter may be passed as numeric or constant. If e.g. you get the following line as help:
http server set {http_both=0|https_only=1|http_only=2}
the following instruction pairs are equivalent:
http server set https_only
http server set 1
or
http server set https_both
http server set 0
Numerical parameters can be entered with different bases. Here is an example of the decimal value 11:
|- bgcolor="#C1DDFB" |align="left"|decimal (10) |align="left"|11 |- |- bgcolor="#C1DDFB" |align="left"|hexadecimal (16) |align="left"|0xb |- |- bgcolor="#C1DDFB" |align="left"|octal (8) |align="left"|013 |- |- bgcolor="#C1DDFB" |align="left"|binary (2) |align="left"|0b1011 |- |}
Bit Field Parameter
Some parameters can take several values at the same time. In the following example, all values between 0 and 5 can be set. In the help, this can be recognized by the fact that the values are not separated by the "|" character, but by commas.
"{EVT_SYSLOG=0,EVT_SNMP=1,EVT_EMAIL=2,EVT_SMS=3,EVT_GSMEMAIL=4,EVT_BEEPER=5}"
To set EVT_SYSLOG and EVT_EMAIL in a command, you can use the following syntax:
>extsensor 1 2 0 events type set "EVT_SYSLOG,EVT_EMAIL"
OK.
or numeric
>extsensor 1 2 0 events type set "0,2"
OK.
Additionally you can set all values with "ALLSET" or encode any bit pattern as hexadecimal with a syntax like "#7f1a".
Return Values
If a command is unknown or a parameter is incorrect, the output "ERR." is given at the beginning of the line, followed by a description of the fault. Successful instructions without special return value will be acknowledged by "OK.". All other return values are output within a single line. There are of two exceptions:
- Some configuration changes, that affect TCP / IP and UDP, need a restart to be applied. These parameters are output on two lines. In the first line the current value is shown, on the second row the value after a restart. In the "Cmd Overview" table this is marked with "Note 2".
- Other configurations (such as the assigned IPv6 addresses) have several values that can change dynamically. This is marked with "Note 3" in the "Cmd Overview" table.
Numerical Returns
For parameters that support constants, these constants are output as return values. To better deal with scripting languages, it may be easier to work only with numerical returns. The command "vt100 numeric set ON"
enables that only numerical values appear.
Telnet
If the configuration "Raw Mode" is turned off, it is tried to negotiate the Telnet configuration between client and server using IAC commands. If this fails, the editing functions are not active, and the "Activate echo" option determines whether the characters sent to the Telnet server will be returned. Normally the client begins with the IAC negotiation. If this is not the case with the client, the device configuration "Active negotiation" should be turned on.
Raw Mode
If you want to use the console only automated, it may be advantageous to set the configuration "Raw mode" to "yes" and "Activate echo" to "no" to. Then there is no interfering interaction with the editor functions and the is no need to filter the sent characters to process the return values.
If in the console "Raw mode" is activated but not in the used Telnet client, the IAC commands sent at the beginning can appear as interfering characters in the command line (partially invisible).
Editing
The following edit functions are available when the terminal supports VT100, and Raw Mode is deactivated. Entered characters are inserted at the cursor position.
|- bgcolor="#C1DDFB"
|align="left"|Keys
|align="left"|Function
|-
|- bgcolor="#C1DDFB"
|align="left"|Left, Right
|align="left"|moves cursor left or right
|-
|- bgcolor="#C1DDFB"
|align="left"|Pos1, End
|align="left"|moves cursor to the beginning or end of line
|-
|- bgcolor="#C1DDFB"
|align="left"|Del
|align="left"|deletes character left of cursor
|-
|- bgcolor="#C1DDFB"
|align="left"|Backspace
|align="left"|deletes character left of cursor
|-
|- bgcolor="#C1DDFB"
|align="left"|Up, Down
|align="left"|shows input lines history
|-
|- bgcolor="#C1DDFB"
|align="left"|Tab, Ctrl-Tab
|align="left"|completes the word at cursor
|-
|- bgcolor="#C1DDFB"
|align="left"|Ctrl-C
|align="left"|clears the line
|-
|}
This chapter is general for all Gude devices. Depending on the device type, ports
or certain sensors may not be available.
Examples of commands
a) External Sensors
>extsensor all show
E=1,L="7106",0="21.3°C",1="35.1%",3="1013hPa",4="5.2°C",5="16.0°C""
E=2,L="7102",0="21.2°C",1="35.4%",4="5.3°C",5="15.9°C""
The command lists one connected external sensor per line, and the individual measured values are separated by commas after the label name. The digit before the equal sign corresponds to the Index field in the External Sensor Table.
>extsensor 1 0 value show
Displays temperature of the sensor at Port 1
b) Line Sensors
For devices with 230V input metering (Metered PDU).
>linesensor all "0,1,2,3,12" show
L=1,L="Power Port",0="13000Wh",1="0W",2="225V",3="0A",12="998218s"
L=2,L="Power Port",0="13000Wh",1="0W",2="223V",3="0A",12="996199s"
This command outputs all line sensor values in one line. A list of all fields (according to the energy sensor table) is transferred as parameter. In this example these are the fields Absolute Active Energy (0), Power Active (1), Voltage (2), Current (3) and Reset Time (12).
>linesensor 1 <cod>"0,1,2,3,12" show
>linesensor 1 1 show
These variants give the sensor values of the field list or of a sensor at Line-In 1. For devices with Overvoltage Protection, the "linesensor all" command also outputs the state of the protection ("OVP=x"). A "1" means ok, a "0" a failure of the protection.
c) Port Sensors
For devices with 230V output metering (Outlet-Metered PDU).
>portsensor all "0,1,2,3,12" show
P=1,L="Power Port",0="13000Wh",1="0W",2="225V",3="0A",12="998218s"
P=2,L="Power Port",0="13000Wh",1="0W",2="225V",3="0A",12="996199s"
...
P=12,L="Power Port",0="13000Wh",1="0W",2="225V",3="0A",12="998218s"
This command outputs all port sensor values in one line. A list of all fields (according to the energy sensor table) is passed as parameter. In this example these are the fields Absolute Active Energy (0), Power Active (1), Voltage (2), Current (3) and Reset Time (12).
>portsensor 2 "0,1,2,3,12"
show
>portsensor 2 1 show
These variants give the sensor values of the field list or a sensor to at Outlet Port 2.
The following examples refer to Gude devices that have switchable ports.
d) Displaying Port Relays
>port all state 1 show
P1=ON,P2=OFF,P3=ON,P4=OFF,P5=OFF,P6=OFF,P7=OFF,P8=ON
The command "port all state {MODE0=0|MODE1=1|MODE2=2} show" returns the switching state of all relays in 3 possible formats.
e) Switching Port Relays
#port all state set "1,2,12" 1
OK.
The command syntax "port all state set "{port_list}" {OFF=0|ON=1}" sets a list of ports to ON=1 or OFF=0.
SSH
The device supports SSH-2 connections with either public key authentication or user name and password. The "login" must be enabled for SSH. Users and passwords can be stored locally or retrieved via a radius server. If you want to use SSH in a terminal, Activate echo should be enabled.
Public Keys
The following public keys are accepted:
|- bgcolor="#C1DDFB" |align="left"|Key type |align="left"|Length |- |- bgcolor="#C1DDFB" |align="left"|RSA |align="left"|2048, 4096 |- |- bgcolor="#C1DDFB" |align="left"|ECDSA |align="left"|256, 384 |- |}
Generation with PuTTYgen
Generated keys can be copied directly from e.g. PuTTYgen,
and inserted into the Configuration - Console input field. Public keys are accepted in SSH2 or OpenSSH format.
Generation with ssh-keygen
The tool ssh-keygen is mostly shipped with Linux and Windows to generate SSH keys.
Here is an example to generate an ECDSA 384 key.
ssh-keygen -t ecdsa -b 384 -f ssh.key
In the file ssh.pub is then the private key, the content of ssh.key.pub is inserted into the field "Upload SSH public key:".