The text of a manual · part 26 of 49
Cyclades-TS User Guide: Chapter 3 - Additional Features, pages 247 to 256
Pages 247 to 256 of 454, from Cyclades-TS User Guide
The original document is the PDF (4.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Cyclades TS2000 and Avocent TS2000
Page 247
Chapter 3 - Additional Features f) program(<program name and arguments>) This driver fork()'s executes the given program with the arguments and sends messages down to the stdin of the child.
Some Examples of Defining Actions 1) To send e-mail: destination <ident> { pipe(‘/dev/cyc_alarm’ template(‘sendmail <pars>’));}; where ident: uniquely identifies this destination. Parameters: -t <name>[,<name>]
To address
[-c <name>[,<name>]]
CC address
[-b <name>[,<name>]]
Bcc address
[-r <name>[,<name>]]
Reply-to address
-f <name>
From address
-s \"<text>\"
Subject
-m \”<text message>\”
Message
-h <IP address or name>
SMTP server
[-p <port>]
Port used. default:25
To mount the message, use this macro: $FULLDATE
The complete date when the message was sent.
$FACILITY
The facility of the message.
$PRIORITY or $LEVEL
The priority of the message.
$PROGRAM
The message was sent by this program (BUFFERING or SOCK).
User Guide
247
Page 248
Syslog $HOST
The name of the source host.
$FULLHOST
The name of the source host and the source driver. Format: <source>@<hostname>
$MSG or $MESSAGE
The message received.
Example to send e-mail to z@none.com (SMTP's IP address 10.0.0.2) from the e-mail address a@none.com with subject “TS-ALARM”. The message will carry the current date, the hostname of this TS and the message that was received from the source. destination d_mail1 { pipe('/dev/cyc_alarm' template('sendmail -t z@none.com -f a@none.com -s \'TS-ALARM\' \ -m \'$FULLDATE $HOST $MSG\' -h 10.0.0.2')); };
2) To send to pager server (sms server): destination <ident> {pipe(‘/dev/cyc_alarm’ template(‘sendsms <pars>’));}; where ident: uniquely identify this destination 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> Example to send a pager to phone number 123 (Pager server at 10.0.0.1) with message carrying the current date, the hostname of this TS and the message that was received from the source: destination d_pager {
248
Cyclades-TS
Page 249
Chapter 3 - Additional Features pipe(‘/dev/cyc_alarm’ template(‘sendsms -d 123 -m \’$FULLDATE $HOST $MSG\’ 10.0.0.1’)); }; 3) To send snmptrap: destination <ident> {pipe(‘/dev/cyc_alarm’ template(‘snmptrap <pars>’)); }; where ident : uniquely identify this destination pars : -v 1 <snmptrapd IP address> public : community \"\" : enterprise-oid \"\" : agent/hostname <trap number> : 2-Link Down, 3-Link Up, 4-Authentication Failure 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>\" Example to send a Link Down trap to server at 10.0.0.1 with message carrying the current date, the hostname of this TS and the message that was received from the source:
destination d_trap { pipe("/dev/cyc_alarm" template("snmptrap -v1 10.0.0.1 public \"\" \"\" 2 0 \"\" \ .1.3.6.1.2.1.2.2.1.2.1 s \"$FULLDATE $HOST $MSG\" "));
User Guide
249
Page 250
Syslog }; 4) To write in file : destination d_file { file(<filename>);}; Example send message to console : destination d_console { file("/dev/ttyS0");}; Example to write a message in /var/log/messages file: destination d_message { file("/var/log/messages"); }; 5) To write messages to the session of a logged-in user: destination d_user { usertty("<username>"); }; Example to send message to all sessions with root user logged: destination d_userroot { usertty("root"); }; 6) To send a message to a remote syslogd server: destination d_udp { udp("<remote IP address>" port(514)); }; Example to send syslogs to syslogd located at 10.0.0.1 : destination d_udp1 { udp("10.0.0.1" port(514)); };
Task 5: Connect all of the above. To connect the sources, filters, and actions, use the following statement. (Actions would be any message coming from one of the listed sources. A match for each of the filters is sent to the listed destinations.) log { source(S1); source(S2); ... filter(F1);filter(F2);... destination(D1); destination(D2);... };
250
Cyclades-TS
Page 251
Chapter 3 - Additional Features where : Sx
Identifier of the sources defined before.
Fx
Identifier of the filters defined before.
Dx
Identifier of the actions/destinations defined before.
Examples: 1) To send all messages received from local syslog clients to console: log { source(sysl); destination(d_console);}; 2) To send only messages with level alert and received from local syslog clients to all logged root user: log { source(sysl); filter(f_alert); destination(d_userroot); }; 3) To write all messages with levels info, notice, or warning and received from syslog clients (local and remote) to /var/log/messages file: log { source(sysl); source(s_udp); filter(f_messages); destination(d_messages); }; 4) To send e-mail if message received from local syslog client has the string “kernel panic”: log { source(sysl); filter(f_kpanic); destination(d_mail1); }; 5) To send e-mail 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); }; 6) To send messages with facility kernel and received from syslog clients (local and remote) to remote syslogd: log { source(sysl); source(s_udp); filter(f_kern); destination(dudp1); };
User Guide
251
Page 252
Syslog Syslog-ng Configuration to use with Syslog Buffering Feature This configuration example uses the syslog buffering feature, and sends messages to the remote syslogd (10.0.0.1). Step 1: Configure pslave.conf parameters. In the pslave.conf file the parameters of the syslog buffering feature are configured as: conf.DB_facility 1 all.syslog_buffering 100 Step 2: Add lines to syslog-ng.conf. Add the following lines by vi or browser to the 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); };
Syslog-ng Configuration to use with Multiple Remote Syslog Servers This configuration example is used with multiple remote syslog servers. Step 1: Configure pslave.conf parameters. In the pslave.conf file the facility parameter is configured as: conf.facility 1 Step 2: Add lines to syslog-ng.conf. The syslog-ng.conf file needs these lines: # local syslog clients source src { unix-stream("/dev/log"); };
252
Cyclades-TS
Page 253
Chapter 3 - Additional Features # remote server 1 - IP address 10.0.0.1 port default destination d_udp1 { udp("10.0.0.1"); }; # remote server 2 - IP address 10.0.0.2 port 1999 destination d_udp2 { udp("10.0.0.2" port(1999););}; # filter messages from facility local1 and level info to warning filter f_local1 { facility(local1) and level(info..warn);}; # filter messages from facility local 1 and level err to alert filter f_critic { facility(local1) and level(err .. alert);}; # send info, notice and warning messages to remote server udp1 log { source(src); filter(f_local1); destination(d_udp1); }; # send error, critical and alert messages to remote server udp2 log { source(src); filter(f_critic); destination(d_udp2); };
TCP Keepalive The objective of this feature is to allow the TS and to recognize when the socket client (ssh or telnet) goes down without closing the connection properly. Currently, if this happens in a serial port the system administrator must close the connection manually or nobody else can access that port anymore.
How it works The TCP engine of TS or will send a tcp keepalive message (ACK) to the client. If the maximum retry number is reached without an answer from the client, the connection is closed.
User Guide
253
Page 254
TCP Keepalive How to Configure it The configuration is done in the file /bin/init_proc_fs using the linux proc filesystem. # Enable routing echo 1 > /proc/sys/net/ipv4/ip_forward # Enable TCP keepalive timer echo 60 > /proc/sys/net/ipv4/tcp_keepalive_time echo 2 > /proc/sys/net/ipv4/tcp_keepalive_probes # Memory subsystem tunning echo 0 0 > /proc/sys/vm/pagetable_cache echo 2 > /proc/sys/vm/page-cluster echo 16 32 48 > /proc/sys/vm/freepages
254
Cyclades-TS
Page 255
Chapter 3 - Additional Features Terminal Appearance You can change the format of the login prompt and banner that is issued when a connection is made to the system. Prompt and banner appearance can be port-specific as well.
Parameters Involved and Passed Values Terminal Appearance involves the following parameters: all.prompt
This text defines the format of the login prompt. Expansion characters can be used here. Example value: %h login:
all.issue
This text determines the format of the login banner that is issued when a connection is made to the Cyclades-TS. \n represents a new line and \r represents a carriage return. Expansion characters can be used here. Value for this Example: \r\n\ Welcome to terminal server %h port S%p \n\ \r\n all.lf_suppress
This activates line feed suppression. When configured as 0, line feed suppression will not be performed. When 1, extra line feed will be suppressed.
all.auto_answer _input
This parameter is used in conjunction with the next parameter, auto_answer_output. If configured and if there is no session established to the port, this parameter will constantly be compared and matched up to the string of bytes coming in remotely from the server. If a match is found, the string configured in auto_answer_output is sent back to the server. To represent the ESC character as part of this string, use the control character, ^[.
User Guide
255
Page 256
Terminal Appearance all.auto_answer _output
This parameter is used in conjunction with the previous parameter, auto_answer_input. If configured, and if there is no session established to the port, this parameter is sent back to the server when there is a match between the incoming data and auto_answer_input. To represent the ESC character as part of this string, use the control character, ^[.
Configuration for CAS, TS, and Dial-in Access Browser Method Step 1: Point your browser to the Console Server. In the address or location field of your browser type the Console Access Server’s IP address. For example: http://10.0.0.0 Step 2: Log in as root and type the Web root password configured by the Web server. This will take you to the Configuration and Administration page. Step 3: Select the Serial Ports link. Click on the Serial Ports link on the Link Panel to the left of the page or in the Configuration section of the page. This will take you to the Port Selection page. Step 4: Select port(s). On the Port Selection page, choose all ports or an individual port to configure, from the dropdown menu. Click the Submit button. This will take you to the Serial Port Configuration page. Step 5: Scroll down to the Terminal Server section. You can change the settings for Banner Field (issue) and Login Prompt field here. Step 6: Click on the Submit button. Step 7: Make the changes effective. Click on the Administration > Run Configuration link, check the Serial Ports/ Ethernet/Static Routes box and click on the Activate Configuration button.
256
Cyclades-TS