Console: Unterschied zwischen den Versionen

Aus Gude Systems GmbH
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „Datei:Console_80.png <br /><u>Enable Telnet: </u>Enables Telnet console. <br /><u>Telnet TCP port:</u>Telnet sessions are accepted on this port. <br /><u>R…“)
 
Zeile 1: Zeile 1:
[[Datei:Console_80.png]]
+
<br />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 .
<br /><u>Enable Telnet: </u>Enables Telnet console.
+
 
<br /><u>Telnet TCP port:</u>Telnet sessions are accepted on this port.
+
=Login=
<br /><u>Raw mode:</u>The VT100 editing and the IAC protocol are disabled.
+
<br />A ssh / telnet log in can be configured with password or without:
<br /><u>Activate echo:</u>The echo setting if not changed by IAC.
+
<br /> [[Datei:Login.png]]
<br /><u>Active negotiation:</u>The IAC negotiation is initiated by the server.
+
 
<br /><u>Require user login:</u>Username and password are required.
+
=Command Set=
<br /><u>Delay after 3 failed logins:</u>After 3 wrong entries of username or password, the next login attempt is delayed.
+
<br />
<br /><u>Use radius server passwords:</u>Username and password are validated by a Radius
+
<br />There are several command levels. The following commands are usable from each level:
Sever.
+
 
<br /><u>Use locally stored passwords:</u>Username and password are stored locally
+
|- 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
 +
|-
 +
|}
 +
 
 +
<br />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=
 +
<br />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:
 +
<br />
 +
<br /><code>http server set {http_both=0|https_only=1|http_only=2}</code>
 +
<br />
 +
<br />the following instruction pairs are equivalent:
 +
<br />
 +
<br /><code>http server set https_only</code>
 +
<br /><code>http server set 1</code>
 +
<br />
 +
<br />or
 +
<br />
 +
<br /><code>http server set https_both</code>
 +
<br /><code>http server set 0</code>
 +
<br />
 +
<br />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=
 +
<br />
 +
<br />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.
 +
<br />
 +
<br /><code>"{EVT_SYSLOG=0,EVT_SNMP=1,EVT_EMAIL=2,EVT_SMS=3,EVT_GSMEMAIL=4,EVT_BEEPER=5}"</code>
 +
<br />
 +
<br />To set EVT_SYSLOG and EVT_EMAIL in a command, you can use the following syntax:
 +
<br />
 +
<br /><code>>extsensor 1 2 0 events type set "EVT_SYSLOG,EVT_EMAIL"</code>
 +
<br /><code>OK.</code>
 +
<br />
 +
<br />or numeric
 +
<br />
 +
<br /><code>>extsensor 1 2 0 events type set "0,2"</code>
 +
<br /><code>OK.</code>
 +
<br />
 +
<br />Additionally you can set all values with "ALLSET" or encode any bit pattern as hexadecimal with a syntax like "#7f1a".
 +
<br />
 +
 
 +
=Return Values=
 +
<br />
 +
<br />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=
 +
<br />
 +
<br />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.
 +
Comments
 +
If you use a tool to send an entire file of commands via Telnet, it is helpful, if you can
 +
place comments in there. Beginning with the comment character "#", the remaining
 +
contents of a line is ignored.
 +
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.
 +
This chapter is general for all Gude devices. Depending on the device type, ports
 +
or certain sensors may not be available.
 +
Sensor Examples
 +
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 "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.
 +
4.2.1 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:
 +
 
 +
 
 +
 
 +
 
 +
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:".

Version vom 26. März 2024, 15:30 Uhr


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:
Login.png

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:

  1. 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".
  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. Comments If you use a tool to send an entire file of commands via Telnet, it is helpful, if you can place comments in there. Beginning with the comment character "#", the remaining contents of a line is ignored. 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. This chapter is general for all Gude devices. Depending on the device type, ports or certain sensors may not be available. Sensor Examples 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 "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

  1. 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. 4.2.1 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:



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:".