General Global Commands
Description
The global commands are utilities that run certain commands on more than one SGM. This document is dealing with general purpose utilities,
The global commands syntax is shown in "OS global commands" document
The list of available commands is: update_conf_file, global, asg_cp2blades, asg_clear_table, asg_clear_messages, asg_blade_stats
Those commands are available in the gclish in addition they are available in bash:
gclish name
|
bash name
|
update_conf_file
|
g_update_conf_file
|
global
|
global_help
|
asg_cp2blades
|
asg_cp2blades
|
asg_clear_table
|
asg_clear_table
|
asg_clear_messages
|
asg_clear_messages
|
asg_blade_stats
|
asg_blade_stats
|
Other relevant documents may include "OS global commands" and "CP global commands".
update_conf_file
Usage: update_conf_file <file_name> <var>=<value>
Description: update_conf_file is a utility to add, update and remove variables from configuration files (configuration file format is specified below)
Input parameters:
file-name - Name\Path of .conf file to update. In case of known conf files full path is not required known conf files are: fwkern.conf, simkern.conf var - Variable name value - New value. An empty value will remove the variable from the .conf file (yet "=" sign must be specified)
Example
> cat /home/admin/MyConfFile.txt
-*- 3 blades: 2_01 2_02 2_03 -*-
cat: /home/admin/MyConfFile.txt: No such file or directory
> update_conf_file /home/admin/MyConfFile.txt var1=hello
> cat /home/admin/MyConfFile.txt
-*- 3 blades: 2_01 2_02 2_03 -*-
var1=hello
> update_conf_file /home/admin/MyConfFile.txt var2=24h
> cat /home/admin/MyConfFile.txt
-*- 3 blades: 2_01 2_02 2_03 -*-
var2=24h
var1=hello
> update_conf_file /home/admin/MyConfFile.txt var1=goodbye
> cat /home/admin/MyConfFile.txt
-*- 3 blades: 2_01 2_02 2_03 -*-
var2=24h
var1=goodbye
> update_conf_file /home/admin/MyConfFile.txt var2=
> cat /home/admin/MyConfFile.txt
-*- 3 blades: 2_01 2_02 2_03 -*-
var1=goodbye
Configuration file required format:
The configuration file is composed of lines of variable initialization where each line defines one variable
Line format is: <variable>=<value>
Variable name must not include "=" sign
Note: fwkern.conf and simkern.conf are aligned with this definition
global help
Usage: global help
Description: shows the list of global commands accessible through gclish and their general usage
Example:
> global help
Usage: <command_name> [-b SGMs] [-a -l -r --] <native command arguments>
Executes the specified command on specified blades.
Optional Arguments:
-b blades: in one of the following formats
1_1,1_4 or 1_1-1_4 or 1_01,1_03-1_08,1_10
all (default)
chassis1
chassis2
chassis_active
-a : Force execution on all SGMs (incl. down SGMs).
-l : Execute only on local blade.
-r : Execute only on remote SGMs.
Command list:
arp cat cp cpconfig cplic cpstart cpstop dmesg ethtool fw fw6 fwaccel fwaccel6 fwaccel6_m fwaccel_m ls md5sum mv netstat reboot sim sim6 snapshot_recover snapshot_show_current tail tcpdump top unlock update_conf_file vpn asg
asg_cp2blades
usage: asg_cp2blades [global command-flags] [-s] file-name-full-path [destination-full-path]
Description: this utility copies files from the current SGM to any specified SGMs
Input parameters:
Global command flags – the global flags which specify on which SGMs to be applied on
-s - flag that specify whether to save a local copy of the old file on each of the selected SGMs. The saved copy will reside on the same directory as the original file and will end with .bak.<date>.<time>
file-name-full-path – full path to the file to be copied. If full-path is not specified the file will be searched in current directory.
destination-full-path – full path to a destination location for the file. If destination was not specified, the file will be copied to the source file location
example:
gcpmodule-ch02-01 > cat /home/admin/note.txt
-*- 1 blade: 2_01 -*-
hello world
-*- 2 blades: 2_02 2_03 -*-
cat: /home/admin/note.txt: No such file or directory
gcpmodule-ch02-01 > asg_cp2blades /home/admin/note.txt
Operation completed successfully
gcpmodule-ch02-01 > cat /home/admin/note.txt
-*- 3 blades: 2_01 2_02 2_03 -*-
hello world
asg_clear_table
usage: asg_clear_table [global command-flags]
Description: clears firewall connection table. This function will delete connections from fw connection table. Its success indication is having less than 50 connections; it will repeat delete process for up to 15 times until meeting this threshold. Note: if connected to the machine by SSH, this command will delete current connection and user will need to re-establish the connection
asg_clear_messages
usage: asg_clear_messages [global command-flags]
Description: clears all messages in /var/log/messages files
Example:
gcpmodule-ch02-01 > asg_clear_messages
This action will erase the messages in /var/log/messages
and will be executed on blades: all
Are you sure? (Y - yes, any other key - no) y
Command completed successfully
> asg_varlog
Dec 5 16:33:07 2_01 cpmodule-ch02-01 clish[30185]: cmd by admin: asg_varlog
gcpmodule-ch02-01 >
Example
> show interface eth1-01 ipv4-address
1_01:
ipv4-address 4.4.4.10/24
1_02:
ipv4-address 4.4.4.10/24
1_03:
ipv4-address 4.4.4.10/24
1_04:
ipv4-address 4.4.4.10/24
1_05:
Blade 1_05 is down. See "/var/log/messages".
2_01:
ipv4-address 4.4.4.10/24
2_02:
ipv4-address 4.4.4.10/24
2_03:
ipv4-address 4.4.4.10/24
2_04:
ipv4-address 4.4.4.10/24
2_05:
ipv4-address 4.4.4.10/24
|