Administration. Avocent Cyclades ACS Advanced Console Server
تبلیغات
تبلیغات
C H A P T E R
5
Administration
Process Monitoring
The command “w” displays information about the currently logged-in users and their processes. It calls two commands, w_ori and w_cas. The w_ori is the new name of the original command -w and the w_cas displays the CAS session’s information.
The header of w_ori displays the current time, how long the system has been running, how many users are currently logged on (excluding the CAS users) and the system load averages for the past one, five and fifteen minutes.
The following entries are displayed for each user (excluding the CAS users).
• Login name
• The tty name
• The remote host
• Login time
• Idle time
• JCPU time - It is the time used by all processes attached to the tty
• PCPU time - It is the time used by the current process named in the “what” field
• The command line of the user’s current process
The header of w_cas displays how many CAS users are currently logged on. The following entries are displayed for each CAS user.
• Login name
• The tty name
• The remote host and remote port
• Login time
• The process ID
• The command line of the current process
85
86 Cyclades ACS Advanced Console Server Command Reference Guide
The Process Table
The process table displays which processes are running. Type
ps -a
to see a table similar to the following.
Table 5.1: Process Table
PID
1
31
32
36
154
UID
root root root root root
VmSize
592
928
584
1148
808
S
R
S
S
State
S
Command
/sbin/inetd
/sbin/inetd
/sbin/cy_ras
/sbin/cy_wdt_led wdt led
/ps -a
To restart the cy_ras process, use its process ID or execute the following command.
# runconf
This executes the ps command, searches for the cy_ras process id, then sends the signal hup to the process, all in one step. Never kill cy_ras with the signals -9 or SIGKILL.
Start and Stop Services
This feature enables or disables services without rebooting the Cyclades ACS console server.
Syntax
daemon.sh [-h|help] | [{[stop|restart] service_id}...] where service_id may be any choice of:
EVTGEN NIS RPC DB NET LOG SSH NTP SNMP IPSEC PMD LP WEB GDF LOGPIPE
ADSAP2
The daemon.sh may be executed in two ways.
1.
Without parameters in the command line. It checks the configuration files of the service and restart or stop it if needed.
2.
It performs the requested action (stop/restart) in the list of services given in the command line regardless of any configuration changes.
The following example restarts power management and data buffering services and it stops SSH and network timer client services.
# daemon.sh PMD stop SSH NTP restart DB
Chapter 5: Administration 87
Syslog-ng
Syslog-ng daemon reads log system console messages and log files on remote syslog servers as specified by its configuration file. In addition, syslog-ng may filter messages based on its content and perform an action, for example send an email or pager message. The /etc/syslog-ng/syslogng.conf file is used to perform specific configurations.
To configure syslog-ng:
1.
Define Global Options options { opt1(params); opt2(params); ... };
Table 5.2: Global Options Parameters (Syslog-ng Configuration)
Option
time_reopen(n) time_reap(n) sync_freq(n) mark_freq(n) log_fifo_size(n) chain_hostname
(yes/no) or long_hostname
(yes/no) use_time_recvd
(yes/no) use_dns (yes/no)
Description
The time to wait before a dead connection is re-established.
The time to wait before an idle destination file is closed.
The number of lines buffered before written to file. (The file is synced when this number of messages has been written to it.)
The number of seconds between two MARKS lines.
The number of lines fitting to the output queue.
Enable/disable the chained hostname format.
gc_idle_threshold(n) gc_busy_threshold(n) create_dirs(yes/no) owner(name)
group(name) perm(mask)
Use the time a message is received instead of the one specified in the message.
Enable or disable DNS usage. syslog-ng blocks on DNS queries, so enabling
DNS may lead to a Denial of Service attack.
Sets the threshold value for the garbage collector, when syslog-ng is idle. GC phase starts when the number of allocated objects reach this number.
Default: 100.
Sets the threshold value for the garbage collector. When syslog-ng is busy,
GC phase starts.
Enable the creation of new directories.
Set the owner of the created file to the one specified. Default: root.
Set the group of the created file to the one specified. Default: root.
Set the permission mask of the created file to the one specified.
Default: 0600.
88 Cyclades ACS Advanced Console Server Command Reference Guide
2.
Define Sources source <identifier> { source-driver([params]); source driver([params]); ...}; where,
• identifier - Uniquely identifies a given source.
• source-driver - A method of retrieving a given message.
• params - Each source-driver takes a required or an optional parameter.
Table 5.3: Source Drivers Parameters (Syslog-ng Configuration)
Option
internal()
unix-stream
(filename [options]) and unix-dgram
(filename [options])
Description
Messages are generated internally in syslog-ng.
They open the given AF_UNIX socket and start listening for messages.
Options: owner(name), group(name), perm(mask) are equal global options.
tcp([options]) and udp([options]) file(filename) pipe(filename) keep-alive(yes/no) - Selects whether to keep connections opened when syslog-ng is restarted. May be used only with unix_stream. Default: yes max-connections(n) - Limits the number of simultaneously opened connections. May be used only with unix_stream. Default: 10.
These drivers let you receive messages from the network, and as the name of the drivers show, you may use both TCP and UDP.
None of tcp() and udp() drivers require positional parameters. By default they bind to 0.0.0.0:514, which means that syslog-ng listens on all available interfaces.
Options: ip(<ip address>) - The binding IP address. Default: 0.0.0.0.
port(<number>) - UDP/TCP port used to listen messages. Default: 514.
max-connections(n) - Limits the number of simultaneously opened connections. Default: 10.
Opens the specified file and reads messages.
Opens a named pipe with the specified name and listens for messages.
(You need to create the pipe using the mkfifo command).
The following are examples of how to define sources.
• Read from a file. source <identifier> {file(filename);};
• Read messages from /temp/file1 file. source file1 {file(‘/temp/file1’);};
• Receive messages from the kernel.
Chapter 5: Administration 89 source s_kernel { file(‘/proc/kmsg’); };
• Receive messages from local syslogd clients. source sysl {unix-stream(‘/dev/log’);};
• Receive messages from remote syslogd clients.
source s_udp { udp(ip(<cliente ip>) port(<udp port>)); };
• Listen to messages from all machines on UDP port 514.
source s_udp { udp(ip(0.0.0.0) port(514));};
• Listen to messages from a client at IP address=10.0.0.1 on UDP port 999.
source s_udp_10 { udp(ip(10.0.0.1) port(999)); };
3.
Define Filters filter <identifier> { expression; }; where,
• identifier - Uniquely identifies a given filter.
• expression - Builds a boolean expression using internal functions.
Table 5.4: Filters Parameters (Syslog-ng Configuration)
Option
facility
(<facility code>) level(<level code>) or priority
(<level code>)
Description
Selects messages based on their facility code.
Selects messages based on their priority.
program(<string>) host(<string>) match(<string>)
Tries to match the <string> to the program name field of the log message.
Tries to match the <string> to the hostname field of the log message.
Tries to match the <string> to the message itself.
The following are examples of how to define filters.
• To filter by facility.
filter f_facilty { facility(<facility name>); };
Examples: filter f_daemon { facility(daemon); }; filter f_kern { facility(kern); }; filter f_debug { not facility(auth, authpriv, news, mail); };
90 Cyclades ACS Advanced Console Server Command Reference Guide
• To filter by level. filter f_level { level(<level name>);};
Examples: filter f_messages { level(info .. warn)}; filter f_emergency { level(emerg); }; filter f_alert { level(alert); };
• To filter by matching a string in the received message.
filter f_match { match(‘string’); };
Example to filter by matching the string named: filter f_named { match(‘named’); };
• To filter alarm messages.
filter f_alarm { facility(local[0+<conf.DB_facility>]) and level(info) and match('ALARM') and match('<your string>'); } ;
Example to filter alarm message with the string kernel panic: filter f_kpanic { facility(local[0+<conf.DB_facility>]) and level(info) and match('ALARM') and match('kernel panic'); };
• To eliminate SSHD debug messages.
filter f_sshd_debug { not program('sshd') or not level(debug); };
• To filter the syslog_buffering.
filter f_syslog_buf { facility(local[0+<conf.DB_facility>]) and level(notice); };
• To define actions (destinations).
destination <identifier> {destination-driver([params]); destinationdriver([param]);..}; where,
• identifier - Uniquely identifies a given destination.
• destination driver - Configures a method of output for a given message.
• params - Configures a required or an optional parameter for each destination-driver.
Chapter 5: Administration 91
Table 5.5: Destination Drivers Parameters (Syslog-ng Configuration)
Option
file
(filename[options])
Description
This is one of the most important destination drivers in syslog-ng. It allows you to output log messages to the named file. The destination filename may include macros (by prefixing the macro name with a '$' sign) which gets expanded when the message is written. Since the state of each created file must be tracked by syslog-ng, it consumes some memory for each file. If no new messages are written to a file within 60 seconds (controlled by the time_reap global option), it's closed, and its state is freed.
pipe
(filename[options]) unix-stream(filename) and unix-dgram(filename) udp(“<ip address>” port(number);) and tcp("<ip address>" port(number);) program(<program name and arguments>) usertty(<username>)
Available macros in filename expansion:
HOST - The name of the source host from where the message originated.
FACILITY - The name of the facility from which the message is tagged.
PRIORITY or LEVEL - The priority of the message.
PROGRAM - The name of the program the message was sent by.
YEAR, MONTH, DAY, HOUR, MIN, SEC - The year, month, day, hour, min, sec of the message was sent.
TAG - Equals FACILITY/LEVEL.
FULLHOST - The name of the source host and the source-driver:
<source-driver>@<hostname>
MSG or MESSAGE - The message received.
FULLDATE - The date of the message was sent.
Available options: log_fifo_size(number) - The number of entries in the output file.
sync_freq(number) - The file is synced when this number of messages has been written to it.
owner(name), group(name), perm(mask) - Equals global options.
template(“string”) - Syslog-ng writes the “string” in the file. You may use the
MACROS in the string. encrypt(yes/no) - Encrypts the resulting file.
compress(yes/no) - Compresses the resulting file using zlib.
This driver sends messages to a named pipe. Available options: owner(name), group(name), perm(mask) - Equals global options.
template(“string”) - Syslog-ng writes the “string” in the file. You may use the
MACROS in the string.
This driver sends messages to a UNIX socket in either SOCKET_STREAM or SOCK_DGRAM mode.
This driver sends messages to another host (ip address/port) using either
UDP or TCP protocol.
This driver fork executes the given program with arguments and sends messages down to the stdin of the child.
This driver writes messages to the terminal of a logged-in username.
92 Cyclades ACS Advanced Console Server Command Reference Guide
The following is an example of how to send an email.
destination <ident> { pipe(‘/dev/cyc_alarm’ template(‘sendmail
<pars>’));}; where <ident> uniquely identifies the destination.
Table 5.6: Send Email Parameters
Email field
To address
CC address
Bcc address
Reply-to address
From address
Subject
Message
SMTP server
Port used. default:25
Parameter
-t <name>[,<name>]
[-c <name>[,<name>]]
[-b <name>[,<name>]]
[-r <name>[,<name>]]
-f <name>
-s \"<text>\"
-m \”<text message>\”
-h <IP address or name>
[-p <port>]
Table 5.7 shows the message mount parameters.
Table 5.7: Message Mount Parameters
Parameter
$FULLDATE
$FACILITY
$PRIORITY or $LEVEL
$PROGRAM
$HOST
$FULLHOST
$MSG or $MESSAGE
Description
The complete date when the message was sent.
The facility of the message.
The priority of the message.
The message was sent by this program (BUFFERING or SOCK).
The name of the source host.
The name of the source host and the source driver
Format: <source>@<hostname>
The message received.
Chapter 5: Administration 93
The following example displays an email sent to [email protected] (SMTP's IP address 10.0.0.2) from the email address [email protected] with subject “ALARM”. The message carries the current date, hostname of the Cyclades ACS console server and the message received from the source. destination d_mail1 { pipe('/dev/cyc_alarm' template('sendmail -t [email protected] -f [email protected] -s \”ALARM\” \\
-m \'$FULLDATE $HOST $MSG\' -h 10.0.0.2'));
};
The following example shows how to send a message to the sms server.
destination <ident> {pipe(‘/dev/cyc_alarm’ template(‘sendsms
<pars>’));}; where <ident> uniquely identify the destination. The parameters are: pars: -d <mobile phone number>
-m \’<message - max.size 160 characters>\’
-u <username to login on sms server>
-p <port sms - default : 6701>
<server IP address or name>
The following example sends a page to phone number 123 (Pager server at 10.0.0.1) with the message carrying the current date, the hostname of the Cyclades ACS console server and the message received from the source.
destination d_pager { pipe(‘/dev/cyc_alarm’ template(‘sendsms -d 123 -m \’$FULLDATE $HOST $MSG\’
10.0.0.1’));
};
Sending an snmptrap
destination <ident> {pipe(‘/dev/cyc_alarm’ template(‘snmptrap
<pars>’)); }; where <ident> uniquely identify the destination. The parameters are:
• pars : -v 1
• <snmptrapd IP address>
• -c public : community
• \"\" : enterprise-oid
• \"\" : agent/hostname
• <trap number> : 2-Link Down, 3-Link Up, 4-Authentication Failure
94 Cyclades ACS Advanced Console Server Command Reference Guide
• 0 : specific trap
• \"\" : host-uptime
• .1.3.6.1.2.1.2.2.1.2.1 :interfaces.iftable.ifentry.ifdescr.1
• s : the type of the next field (it is a string)
• \"<message - max. size 250 characters>\"
The following example sends a Link Down trap to a server at 10.0.0.1 with message carrying the current date, the hostname Cyclades ACS console server and the message received from the source.
destination d_trap { pipe("/dev/cyc_alarm" template("snmptrap -v 1 -c public 10.0.0.1 public \"\" \"\" 2 0 \"\"
\\ .1.3.6.1.2.1.2.2.1.2.1 s \"$FULLDATE $HOST $MSG\" "));
};
Sending a message to a remote syslogd server
destination d_udp { udp("<remote IP address>" port(514)); };
The following example sends syslogs to syslogd located at 10.0.0.1 : destination d_udp1 { udp("10.0.0.1" port(514)); };
Connecting sources, filters and actions
To connect the sources, filters and actions use the following statement. An action is an incoming message from one of the listed sources. A match for each of the filters is sent to the listed destination.
log { source(S1); source(S2); ... filter(F1);filter(F2);...
destination(D1); destination(D2);...
}; where,
• Sx - Identifies the defined sources.
• Fx - Identifies the defined filters.
• Dx - Identifies the defined actions or destinations.
Examples of connecting sources, filters and actions:
• To send all messages received from local syslog clients to console.
log { source(sysl); destination(d_console);};
• To write all messages with levels info, notice or warning and received from syslog clients
(local and remote) to /var/log/messages file.
Chapter 5: Administration 95 log { source(sysl); source(s_udp); filter(f_messages); destination(d_messages); };
• To send an email if message received from local syslog client has the string kernel panic.
log { source(sysl); filter(f_kpanic); destination(d_mail1); };
• To send an email and pager if message received from local syslog client has the string
“root” login.
log { source(sysl); filter(f_root); destination(d_mail1); destination(d_pager); };
• To send messages with facility kernel and received messages from syslog clients (local and remote) to remote syslogd.
log { source(sysl); source(s_udp); filter(f_kern); destination(dudp1); };
To use syslog-ng configuration with syslog buffering feature:
This configuration example uses the syslog buffering feature and sends messages to the remote syslogd (10.0.0.1).
1.
In /etc/portslave/pslave.conf file configure the syslog buffering parameters.
conf.DB_facility 1 all.syslog_buffering 100
2.
Add the following lines to /etc/syslog-ng/syslog-ng.conf file.
#local syslog clients source src { unix-stream("/dev/log"); }; destination d_buffering { udp("10.0.0.1"); }; filter f_buffering { facility(local1) and level(notice); };
#send only syslog_buffering messages to remote server log { source(src); filter(f_buffering); destination(d_buffering); };
To configure Syslog-ng with multiple remote syslog servers:
1.
Configure syslog facility number to receive messages. The remote syslog server filters receive messages according to this parameter.
cli> config network syslog facility <local0-local7>
2.
Configure the server’s IP address where syslog messages are sent. Repeat this step to add additional remote servers.
cli> config network syslog add server <ip address>
3.
Activate and save your configuration.
96 Cyclades ACS Advanced Console Server Command Reference Guide
Syslog Messages
The Cyclades ACS console server may generate syslog messages to enable system administrators to monitor system changes. Syslog messages are generated when specific actions are performed or certain conditions are met through user entered commands. The system generates and sends messages to a syslog server using the following format.
• Tag - a fixed string used by the user to create filters
EVT[<event number>]:
• Text - the text that contains the condition or action
You may use the information provided in the CYCLADES-ACS-TRAP-MIB.ASN to create filters and generate alarms about the Cyclades ACS console server events.
DCD ON/OFF Syslog Messages
The Cyclades ACS console server may generate an alert when a serial console cable is removed from the Cyclades ACS console server or when the serially attached server is turned off. Also, when a modem is connected, this feature may detect if the modem is still turned on and active.
The DCD signal is monitored and a syslog message is generated when the state of the signal changes. The syslog message may be handled by syslog-ng to generate an event notification.
To configure DCD syslog messages:
1.
Open the /etc/portslave/pslave.conf file.
# vi /etc/portslave/pslave.conf
2.
Set the all.dcd or sXX.dcd parameter to 1 in the /etc/portslave/pslave.conf file.
all.dcd 1
-orsXX.dcd 1
Where XX is the desired port number.
3.
Configure the event_notif conf file to monitor DCD status.
The following example displays generating syslog messages if the DCD signal changes its state.
9=2
10=2
4.
Save the configuration.
# saveconf
Chapter 5: Administration 97
Notifications and Alarms
System notifications allow an administrator to manage servers by filtering the messages generated from a server’s console port. It helps with sending email or pager notifications based on the server’s message content.
Configuring alarm notification
cli> config administration notifications [parameter] <value>
Table 5.8: System Notifications Parameters
Parameter Level2 Parameter Level1
addemail
Value
<trigger string>
Description
Sends a message to the configured email address if the defined string appears.
add Email> from to subject body smtpserver smtpport cancel addpager <trigger string> Sends a message to the configured pager if the defined string appears.
add Pager> number smsport smsserver smsusername text cancel
<string>
<number>
<string>
<string>
<string>
98 Cyclades ACS Advanced Console Server Command Reference Guide
Table 5.8: System Notifications Parameters (Continued)
Parameter Level2 Parameter Level1
addsnmptrap
Value
<trigger string> add Snmptrap> body community oid server cancel trapnum
<string>
<string>
<string>
<string>
0-6 authfailure coldstar egpneighborloss enterprisespecific linkdown linkup warmstart
Description
Sends a SNMP trap to the configured server if the defined string appears.
alarm delete edit yes|no Activate or deactivate the alarm feature. If you don't enable it, syslog messages won’t be generated when there is incoming data from the ports.
Delete any previously configured string.
Edit any previously configured string.
To configure notifications:
The following example demonstrates configuring the Cyclades ACS console server to send an email every time the root user logs into a server connected to a serial port. The trigger string is configured as root login. The server connected to the Cyclades ACS console server must be properly configured to send Syslog messages.
1.
Enable alarm notification, otherwise messages received through the serial ports are ignored.
cli> config administration notifications alarm yes
2.
Add a trigger string.
cli> config administration notifications addemail "root login"
3.
Configure the email notification parameters and SMTP server and port id.
add Email>body "Testing configuration" add Email>from ACSConsoleServer add Email>to [email protected]
add Email>smtpserver 200.200.200.2
Chapter 5: Administration 99 add Email>smtpport 25 add Email>subject "Testing Config"
4.
Activate and save your configuration.
Dual Power Management
The Cyclades ACS console server comes with two power supplies which it may self-monitor. If either of them fails, two actions are performed, sounding a buzzer and generating a syslog message.
This automanagement may be disabled (no actions are taken) or enabled (default), any time by issuing the commands.
# signal_ras buzzer off
# signal_ras buzzer on
To disable the buzzer in boot time, edit the shell script /bin/ex_wdt_led.sh and remove the keyword buzzer. The buzzer won’t sound if there is a power failure in any power supply. This parameter does not affect the behavior of the command signal_ras buzzer on/off. To make this change effective even after future reboots, create a line with /bin/ex_wdt_led.sh in /etc/config_files, save and quit the file and run saveconf.
NOTE: This section applies only to the dual power supply model of the Cyclades ACS console server.
Date and Time, Timezone and Daylight Saving
To adjust the date and time, use the date command. Timezone is configured using the CLI utility or
WMI (see ACS Installation, Administration and User Guide for using the WMI to set time, date and timezone information.)
NOTE: Setting the system timezone creates a new file called /etc/localtime, which erases /etc/TIMEZONE.
Daylight Saving Time (DST)
When the DST parameter is set to on, the Cyclades ACS console server automatically adjusts its time information to comply with the time shift appropriate to the target timezone. For states, countries or regions that do not observe daylight saving time, the dst parameter must be set to off even if other regions in the target timezone do observe the daylight saving time change.
In rare occurrences or under special circumstances, a region or country might require that a customized daylight saving time be used. Such circumstances might require a temporary or permanent change of date for the beginning and ending of daylight time, or a time offset greater or less than the usual one hour. Instructions follow for customizing the daylight saving time parameters.
Enter the following command to set the date and time. For configuration parameters see Table 5.9.
100 Cyclades ACS Advanced Console Server Command Reference Guide cli> config administration date/time [parameter] <value>
Table 5.9: Date and Time Configuration Parameters
Parameter
date time
Value
<mm/dd/yy>
<hh:mm:ss>
Enter the following command to set the timezone. For configuration parameters see Table 5.10.
cli> config administration timezone [parameter] <value>
Table 5.10: Timezone Configuration Parameters
Parameter
Level1
Parameter
Level2 Value
Custom zonelabel Timezone name
Description
May be any custom name you choose (such as, “London,”
“ChicagoOffice,” or “Sydney”), or may be a numerical value.
acronym gmtoff dst dstacronym DST acronym dstsave
Timezone acronym The abbreviated name for the zonelabel. For example “PST” for “Pacific Standard Time.”
<hh:mm> off|on
GMT Offset: This is the number of hours either ahead (+) or behind (-) Greenwich Mean Time (GMT) in hours. For example, PST, the offset is -8:00 hours.
Daylight Saving Time (DST): Set to “on” for custom daylight saving time settings to be active.
<hh:mm>
The abbreviated name used to describe the timezone when daylight saving time is in effect. For example, “PDT” for Pacific
Daylight Time.
This is the amount of time that the clock moves forward or back at the beginning and end of daylight saving time for the target timezone.
dststartday (see format in
Description) dststarttime <hh:mm> dstendday dstendtime
(see format in
Description)
<hh:mm>
The day <Jan, . . . ,Dec>/<1st,...,4th,last>/<Sun,...,Sat>/ that
DST starts for the target timezone.
The precise time of day (hh:mm) that DST starts for the target timezone.
The day <Jan, . . . ,Dec>/<1st,...,4th,last>/<Sun,...,Sat>/ that
DST ends for the target timezone.
The precise time of day (hh:mm) that DST ends for the target timezone.
Chapter 5: Administration 101
Table 5.10: Timezone Configuration Parameters (Continued)
Parameter
Level1
Parameter
Level2 Value
Standard
.
.
.
01h_east_GMT
14h_east_GMT
GMT
.
01h_west_GMT
.
.
12h_west_GMT
Description
The following are examples of configuring timezones.
cli> config administration timezone custom acronym PDT cli> config runconfig cli> config savetoflash cli> config administration timezone standard 08h_west_GMT cli> config runconfig cli> config savetoflash cli> config administration timezone custom dst on dstacronym PDT
dststartday Mar/2nd/Sun dstendday Nov/1st/Sun
cli> config runconfig cli> config savetoflash
Network Time Protocol (NTP)
The ntpclient is a Network Time Protocol client for UNIX and Linux based systems. In order for the Cyclades ACS console server to work as an NTP client, the IP address of the NTP server must be configured.
To configure an NTP server:
1.
Execute the following command to configure the NTP server IP address.
cli> config administration ntp <NTP server IP address>
2.
Activate and save your configuration.
102 Cyclades ACS Advanced Console Server Command Reference Guide
NOTE: To deactivate the NTP service you need to configure date by issuing the following command: cli> config administration date/time date <mm/dd/yyyy>
Session Sniffing
When multiple sessions are allowed for one serial port, the behavior of the Cyclades ACS console server is as follows.
• The first user to connect to the port opens a common session.
• From the second connection onwards, only admin users are allowed to connect to that port.
The Cyclades ACS console server opens the following menu to these administrators, which is defined by the parameter all.admin_users or sN.admin_users in the file pslave.conf.
——————————————————————————————————————————————————————
* * * ttySN is being used by (<first_user_name>) !!!
*
1 - Initiate a regular session
2 - Initiate a sniff session
3 - Send messages to another user
4 - Kill session(s)
5 - Quit
Enter your option:
——————————————————————————————————————————————————————
If you select 1 - Initiate a regular session, the serial port is shared with the users that were previously connected. You are able to read and write to the serial port.
If you select 2 - Initiate a sniff session, you may read everything that is sent or received through the serial port, according to the parameter all.sniff_mode or sN.sniff_mode.
If you select 3 - Send messages to another user, the Cyclades ACS console server sends your messages to all the sessions, but not to the tty port. Everyone connected to that port sees all exchanges of information as if they were physically in front of the console. These messages are formatted as,
[Message from user/PID] <<message text goes here>> by the ACS.
If you select 4 - Kill session(s), the Cyclades ACS console server displays a list of PID/username pairs. You are able to select a session by typing its PID, or all to kill all sessions. If you kill all the regular sessions, a regular user session initiates automatically.
Select Option 5 - Quit to close the current session and the TCP connection.
Chapter 5: Administration 103
NOTE: Typing all.escape_char or sN.escape_char from the sniff session or send message mode makes the
Cyclades ACS console server to show the previous menu. The first regular sessions are not allowed to return to the menu. If you kill all regular sessions using option 4, your session initiates as a regular session automatically.
To configure session sniffing:
1.
Execute the following command for one or multiple serial ports. Refer to Table 5.11 for session
sniffing parameters. cli> config physicalports <'all' or range/list[1-xx]> multiuser
[parameter] <value>
2.
Activate and save your configuration.
Table 5.11: Session Sniffing Parameters
Parameter
hotkey
Value
<^(character)> notifyusers multisessions privilegeusers sniffmode yes|no no | ro | rw | yes
<list of user names separated by commas> in | inout | no | urt
Description
To configure the escape character. The selected character must be preceded by the ‘^’ character. For example, ^k.
To configure multiuser notification.
To configure multiple sessions.
To determine which users may receive the sniff menu.
Determines what other users connected to the very same port may see of the session of the first connected user (main session). Valid values are: in - shows data written to the port; out - shows data received from the port; in/out - shows both streams; off - disables sniffing.
Data Buffering
Data buffering may be done in local files or in remote files through NFS. When using remote files, the limitation is imposed by the remote server (disk/partition space) and the data is kept in linear
(sequential) files in the remote server. When using local files, the limitation is imposed by the size of the available ramdisk. You may wish to have data buffering done in file, syslog or both. For syslog, all.syslog_buffering and conf.DB_facility are the parameters to be dealt with, and syslog-
ng.conf file should be set accordingly. Please see Syslog-ng on page 87 for the syslog-ng
configuration file. The data buffering parameters are configured in file all.data_buffering.
Conf.nfs_data_buffering is a remote network file system where data buffering is written to, instead of the default directory /var/run/DB. When commented, it indicates local data buffering. The directory tree to which the file is written must be NFS-mounted and the local path should point to/ mnt/DB_nfs. The remote host must have NFS installed and the administrator must create, export and allow read/write privileges to the directory. The size of this file is not limited by the value of
104 Cyclades ACS Advanced Console Server Command Reference Guide the parameter s1.data_buffering, though the value cannot be zero since a zero value turns off data buffering.
The conf.nfs_data_buffering parameter format is,
<server name or IP address>:<remote pathname>
For example, if data buffering is enabled for port 1, the data is stored in the file ttyS1.data in local directory /var/run/DB or in remote server indicated by conf.nfs_data_buffering.
Ramdisk
Data buffering files are created in the directory /var/run/DB. If the parameter s<nn>.alias is configured for the port <nn>, this name is used. For example, if the alias is called fremont_server, the data buffering file is named fremont_server.data.
Linear vs. Circular buffering
For local data buffering, this parameter allows users to buffer data in either a circular or linear fashion. Circular format (cir) is a revolving buffer file that is overwritten whenever the limit of the buffer size (set by all.data_buffering) is reached. In linear format (lin), data transmission between the remote device and the serial port ceases once the 4k bytes Rx buffer in the kernel is reached.
Then if a session is established to the serial port, the data in the buffer is shown
(all.dont_show_DBmenu or sxx.dont_show_DBmenu must be 2), cleared and data transmission is resumed. Linear buffering is impossible if flow control is set to none. Default is cir.
To configure data buffering:
1.
Execute the following command to configure data buffering. Refer to Table 5.12 for the
configuration parameters.
cli> config physicalports all databuffering [parameter] <value>
2.
Activate and save your configuration.
Table 5.12: Data Buffering Configuration Parameters
Parameter
bufferonlynosession buffersyslogonlynose ssion desttype filesize mode nfspath
Value
no|yes no|yes local | remote
<file size in bytes> cir | lin
<pathname>
Description
Buffer only when connected to the serial port.
Only syslog is buffered.
Define the data buffering location.
Defines the maximum size of the data buffer file. This parameter must be greater than zero otherwise all parameters relating to data buffering are disregarded.
Choose between circular or linear data buffering.
Define the NFS path.
Chapter 5: Administration 105
Table 5.12: Data Buffering Configuration Parameters (Continued)
Parameter
showmenu syslogserver syslogsize syslogfacility
Value
file | fileanderase | no | noerase | yes
<n.n.n.n>
<record length in bytes[40-255]> local0 - local7
Description
Control the DB menu options.
Defines the IP address of the Syslog server.
Maximum size of syslog data buffer message.
timestamp no|yes
Defines the facility number for messages generated by the
Cyclades ACS console server to be sent to the Syslog server.
Choose YES to enable timestamp and NO to disable it.
Menu Shell
This application allows you to customize a menu presented to users when they connect to the
Cyclades ACS console server from a terminal. The menu may be configured to allow users to connect to different servers on the local network.
When the menu shell is configured you may connect to the Cyclades ACS console server using a serial terminal. You may select a server to connect to from the list or exit the system.
Welcome!
1) Sun server
2) Dell server
3) Linux server
4) Quit
Option ==>
To configure and set up a Menu Shell:
1.
Assign the menu shell to users who require access using the options provided by the menush_cfg utility.
106 Cyclades ACS Advanced Console Server Command Reference Guide
Type menush_cfg and use the available options to define a menu title and menu commands.
-------------------------------------------------
MenuShell Configuration Utility
-------------------------------------------------
Please choose from one of the following options:
1. Define Menu Title
2. Add Menu Option
3. Delete Menu Option
4. List Current Menu Settings
5. Save Configuration to Flash
6. Quit
Option ==>
2.
Choose Add Menu Option and complete the requested fields. The following question defines the action that must be taken.
Enter the command for the new menu option:
3.
Select option 5 to save the configuration changes to Flash.
NOTE: Action may be telnet host_ip or ssh -l username host_ip where host_ip is the IP address of the target server.
To assign ports to the menu shell:
1.
If no authentication is required to gain access to the menu, configure the following parameters in /etc/portslave/pslave.conf for the ports that use this menu shell.
s<x>.protocol telnet conf.telnet /bin/menush s<x>.authtype none
Where <x> is the port number being configured.
2.
If authentication is required to gain access to the menu, the user’s default shell must be modified to run the /bin/menush. In /etc/passwd the shell should be changed as per the following example.
user:FrE6QU:505:505:Embedix User,,,:/home/user:/bin/menush
3.
In pslave.conf, the port where the serial terminal is attached must be configured for login with local authentication.
s<x>.protocol login s<x>.authtype local
Where <x> is the port number being configured.
4.
Activate and save the configuration changes.
# runconf
# saveconf
Chapter 5: Administration 107
108 Cyclades ACS Advanced Console Server Command Reference Guide
To set up which servers the users may access:
1.
Enter the following command to set up a menu, which is prompted when you connect from a
dumb terminal. Refer to Table 5.13 for configuration parameters.
cli> config applications terminalmenu add [parameter] <value>
2.
Activate and save your configuration.
Table 5.13: Terminal Profile Menu Configuration Parameters
Parameter
menutitle actionname command
Value
<string>
<action name>
<string>
Description
Type a description for the menu title bar.
Enter n identification for the command. For example, server name.
Enter a command such as telnet host_ip.
NOTE: You may open an SSH connection to the desired server. To do so, substitute telnet host_ip with ssh -l username host_ip.
Terminal Appearance
You may change the banner appearance when a connection is made to a server. The banner appearance may be port-specific or a unified banner for all ports.
To configure the terminal appearance:
1.
Enter the following command to configure a banner for one or multiple serial ports. cli> config physicalports [all|range] other banner "<login banner>"
NOTE: A banner string with spaces must be enclosed by double quotes "<string1 string2>".
2.
Activate and save your configuration.
Chapter 5: Administration 109
SUDO Configuration Group
SUDO configuration group allows users belonging to the administrator (admin) group, by way of commands from the shell command line, to configure the Cyclades ACS console server’s features provided by the WMI and CLI.
NOTE: As supplied, the Cyclades ACS console server (version 2.6.1 and up) provides a user admin from the admin group with the password cyclades. The username admin cannot be added or deleted from the WMI, or the
CLI, so if a user with the username admin belonging to the admin group is required, a shell script must be executed by user root from the shell command line.
The sudoers configuration file has already been configured to allow execution and modification of commands, utilities and configuration files by a user from the admin group.
The sudoers file, /etc/sudoers may be edited by user root either to exclude or to include commands, utilities and configuration files that are to be used with the sudo command by users from the admin group.
NOTE: The sudoers file is not saved to Flash automatically. If you make changes to this file and wish to save the changes, follow the standard procedure to save the config_files file.
For an admin group user to be allowed to execute commands from the shell prompt, the sudo command must be used. Commands requiring root access privileges are executed by an admin user with the following command.
$ sudo shell_command_|shell_utility|ACS_utility [other required
parameters]
If a user with username admin belonging to the admin group is required, the following shell script must be executed by user root to configure it.
# addadmin
Saveconf and Restoreconf
The Cyclades ACS console server has two utilities for saving and restoring the configuration.
Saveconf utility
The saveconf utility automatically creates a file in Flash to save the default and replace flags. The filename is /mnt/flash/config.tgz.You can also save a configuration file to and restore a configuration file from a remote ftp, tftp or ssh server.
110 Cyclades ACS Advanced Console Server Command Reference Guide
Syntax
Enter the following at the shell prompt to see the syntax for the options:
# saveconf --help
Usage:
Save to flash: saveconf
Save to storage device: saveconf sd [default] [replace]
Save to local file: saveconf local <FILE>
Save to FTP server: saveconf ftp <FILE> <FTP_SERVER> <USER>
<PASSWORD>
Save to TFTP server: saveconf tftp <FILE> <TFTP_SERVER>
Save to SSH server: saveconf ssh <FILE> <SSH_SERVER> <USER>
Table 5.14: Saveconf Utility and Storage Device Parameters
Media Description
<none> Save the configuration to internal Flash.
sd [default] [replace] Save the configuration to a PC card storage device
(Compact Flash or IDE).
local <File> ftp <remote path and filename> <IP address of the FTP server> <username> <password>
Save the configuration to the path and filename.
Save the configuration to a remote FTP server.
tftp <remote path and filename> <IP address of the TFTP server>
Save the configuration to a remote TFTP server.
ssh <remote path and filename> <IP address of the SSH server> <username>
Save the configuration to a remote SSH server.
Chapter 5: Administration 111
Restoreconf utility
Syntax
Enter the following at the shell prompt to see the syntax for the options:
# restoreconf --help
Usage:
Restore from flash : restoreconf
Restore from factory default: restoreconf factory_default
Restore from storage device: restoreconf sd
Restore from local file : restoreconf local <FILE>
Restore from FTP server : restoreconf ftp <FILE>
<FTP_SERVER> <USER> <PASSWORD>
Restore from TFTP server : restoreconf tftp <FILE>
<TFTP_SERVER>
Restore from SSH server : restoreconf ssh <FILE>
<SSH_SERVER> <USER>
Table 5.15: Restoreconf Utility and Storage Device Parameters
Media
<none>
Description
Read the configuration file from the PC card storage device and if the DEFAULT flag is set, use this file as the configuration default. If the REPLACE flag is set, copy this file to the internal Flash of the Cyclades ACS console server. If the DEFAULT flag is not set or there is no configuration file in the PC card storage device, read the configuration from the internal Flash.
local <File> sd
Read the configuration from the path and local file.
Read the configuration from the PC card storage device
(Compact Flash or IDE) and if the REPLACE flag is set, copy the file to the internal Flash of the Cyclades ACS console server.
Read the configuration from the path and filename.
local <File> ftp <remote path and filename> <IP address of the FTP server> <username> <password>
Read the configuration from a remote FTP server.
tftp <remote path and filename> <IP address of the TFTP server>
Read the configuration from a remote TFTP server.
ssh <remote path and filename> <IP address of the SSH server> <username>
Read the configuration from a remote SSH server.
112 Cyclades ACS Advanced Console Server Command Reference Guide
Saving or restoring configuration files using CLI
Use the following commands to save or restore configuration files.
• Save to Flash cli> config savetoflash
• Save to PC card cli> administration backupconfig saveto sd [default] [replace]
• Load from PC card cli> administration backupconfig loadfrom sd [default] [replace]
• Save to FTP server cli> administration backupconfig saveto ftpserverip <n.n.n.n> pathname
<string> username <string> password <string>
• Load from FTP server cli> administration backupconfig loadfrom ftpserverip <n.n.n.n>
pathname <string> username <string> password <string>
Crond
Crond is a service provided by the Cyclades ACS console server that allows automatic, periodically-run custom-made scripts. It replaces the need to run commands manually.
The crond daemon configuration is divided in three parts.
• /etc/crontab_files - The name of this file cannot be changed and it must point only to one file.
• Source file - Holds information about frequency of cron jobs and the files that should be executed. It may have any name, since it is pointed out by the /etc/crontab_files.
• Script files - These are the script files that are scheduled and are pointed by the source file explained previously.
The following parameters are created in the /etc/crontab_files file.
• Status - Active or inactive. The script does not execute if inactive.
• User - The process runs with the privileges of a valid local user.
• Source - Pathname of the crontab file that specifies frequency of execution and the name of shell script. It should be set using the traditional crontab file format.
Example: active root /etc/tst_cron.src
NOTE: In /etc/crontab_files, you may only have one active entry per user. For instance, from the earlier example, you cannot add another active entry for “root” because it already has an entry. If you want to add more scripts, you may just add them to the source file, for example: (/etc/tst_cron.src).
Chapter 5: Administration 113
The /etc/crontab_files file may point to any desired file that calls the scripts to be run. The Cyclades
ACS console server has example file for it (/etc/tst_cron.src). The file that is pointed out in the /etc/ crontab_files file must follow the following structure.
PATH=/usr/bin:/bin
SHELL=/bin/sh
HOME=/
0-59 * * * * /etc/tst_cron.sh
This file is called /etc/tst_cron.src. It can have any name, but it follows structure showed previously. The fourth line of the example file follows this structure: minutes, hours, month day, month, week day and command. It is possible to specify different tasks to run on different dates and
times. Each command must be on separated lines. See Crontab syntax.
Crontab syntax
A crontab task consists of four date/time fields and a command field. Every minute cron checks all crontabs for a match between the current date/time and their tasks. If there's a match, the command is executed. The system crontab has an additional field User that tells cron with which user id the command should be executed.
The fields are:
• Min - minute of execution, 0-59
• Hour - hour of execution, 0-23
• Mday - day of month of execution, 1-31
• Month - month of execution, 1-12 (or names)
• Wday - day of week of execution, 0-7 (0 or 7 is sunday, or names)
• Command - Anything that may be launched from the command line
114 Cyclades ACS Advanced Console Server Command Reference Guide
Clustering Using Ethernet Interface
Clustering allows cascading multiple Cyclades ACS console servers so that one master may be used to access all console servers on the network. The master Cyclades ACS console server can manage up to 1024 serial ports. There are no special connections required between the master and slave Cyclades ACS console servers, except they all need to be connected in the same physical
1
7
4
2
5
3
8
6
Figure 5.1: An Example on Using the Clustering Feature
Table 5.16: Example of Using the Clustering Feature Descriptions
Item
1
2
3
4
Description
Cyclades ACS Console Server Master:
Ethernet LAN IP: 20.20.20.1
Secondary IP: 209.81.55.110
Cyclades ACS Console Server Master:
Ethernet LAN IP: 20.20.20.2
Cyclades ACS Console Server Master:
Ethernet LAN IP: 20.20.20.3
Servers on Serial Ports
TCP Port Address Range: 7001 - 7016
Item
5
6
7
8
Description
Servers on Serial Ports
TCP Port Address Range: 7017 - 7032
Servers on Serial Ports
TCP Port Address Range: 7033 - 7048
Management Workstation
IP Address: 20.20.20.10
Remote Management Workstation
Chapter 5: Administration 115
To configure clustering:
1.
Execute the following commands to configure slave Cyclades ACS console servers. Refer to
Table 5.17 for configuration parameters.
cli> config virtualports addslave <slave ip address> cli> Slave [slave ip address]> [parameter] <value>
2.
Activate and save your configuration.
Table 5.17: Clustering Configuration Parameters
Parameter
numports
Value
<list>
Description
Set the total number of ports of the slave unit.
firstlocalportnum <number[17-1024]> This parameter act as the numbering continuation in the slave. If the master unit has 16-ports, the first port of the slave unit is the first local port number, which in this case is port 17.
To set the IP address of the slave.
localip firstlocaltcpport
<n.n.n.n>
<number> This parameter act as the numbering continuation in the slave. If the master unit has 16-ports, the TCP ports numbers are 7001-
7016. In this case the first TCP port number for the slave unit is 7017.
firstremotetcpport <number> protocol ssh | telnet
The first TCP port number in the master unit. In this case is 7001.
Protocol used to access the ports.
Use the following command from the shell prompt to test the configuration.
# ssh -l <username>:<TCP port of the serial port in the slave> <IP
address of the master> -p <TCP port of the virtual port in the master>
Use the following commands to edit or delete a previously configured virtual port.
cli> config virtualports editslave <n.n.n.n> cli> config virtualports deleteslave <n.n.n.n>
116 Cyclades ACS Advanced Console Server Command Reference Guide
دانلود
تبلیغات