- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
07-Device Management Configuration | 162.42 KB |
Contents
Enabling displaying the copyright statement
Configuring the maximum number of concurrent users
Configuring the exception handling method
Rebooting devices immediately at the CLI
Scheduling a job in the non-modular approach
Scheduling a job in the modular approach·
Scheduled job configuration example
Clearing unused 16-bit interface indexes
Displaying and maintaining device management
Overview
Device management includes monitoring the operating status of devices and configuring their running parameters.
The configuration tasks in this document are order independent. You can perform these tasks in any order.
Configuring the device name
A device name identifies a device in a network and works as the user view prompt at the CLI. For example, if the device name is Sysname, the user view prompt is <Sysname>.
To configure the device name:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Configure the device name. |
sysname sysname |
The default device name is the device model name. |
Changing the system time
You must synchronize your device with a trusted time source by using NTP or changing the system time before you run it on the network. Network management depends on an accurate system time setting, because the timestamps of system messages and logs use the system time. For NTP configuration, see Network Management and Monitoring Configuration Guide.
In a small-sized network, you can manually set the system time of each device.
|
IMPORTANT: If you reboot the device, the system time and date are restored to the factory default. To ensure an accurate system time setting, you must change the system time and date or configure NTP for the device. |
Configuration guidelines
You can change the system time by configuring the relative time, time zone, and daylight saving time. The configuration result depends on their configuration order (see Table 1). In the first column of this table, 1 represents the clock datetime command, 2 represents the clock timezone command, and 3 represents the clock summer-time command. To verify the system time setting, use the display clock command. This table assumes that the original system time is 2005/1/1 1:00:00.
Table 1 System time configuration results
Command |
Effective system time |
Configuration example |
System time |
1 |
date-time |
01:00:00 UTC Mon 01/01/2007. |
|
2 |
Original system time ± zone-offset |
02:00:00 zone-time Sat 01/01/2005. |
|
1, 2 |
date-time ± zone-offset |
03:00:00 zone-time Fri 02/02/2007. |
|
2, 1 |
date-time |
03:00:00 zone-time Sat 03/03/2007. |
|
3 |
The original system time outside the daylight saving time range: The system time does not change until it falls into the daylight saving time range. |
01:00:00 UTC Sat 01/01/2005. |
|
The original system time in the daylight saving time range: The system time increases by summer-offset. |
03:00:00 ss Sat 01/01/2005. If the original system time plus summer-offset is beyond the daylight saving time range, the original system time does not change. After you disable the daylight saving setting, the system time automatically decreases by summer-offset. |
||
1, 3 |
date-time outside the daylight saving time range: date-time |
01:00:00 UTC Mon 01/01/2007. |
|
date-time in the daylight saving time range: date-time + summer-offset |
10:00:00 ss Mon 01/01/2007. If the date-time plus summer-offset is outside the daylight saving time range, the system time equals date-time. After you disable the daylight saving setting, the system time automatically decreases by summer-offset. |
||
3, 1 (date-time outside the daylight saving time range) |
date-time |
01:00:00 UTC Tue 01/01/2008. |
|
3, 1 (date-time in the daylight saving time range) |
date-time – summer-offset outside the daylight saving time range: date-time – summer-offset |
23:30:00 UTC Sun 12/31/2006. |
|
date-time – summer-offset in the daylight saving time range: date-time |
03:00:00 ss Mon 01/01/2007. |
||
2, 3 or 3, 2 |
Original system clock ± zone-offset outside the daylight saving time range: Original system clock ± zone-offset |
02:00:00 zone-time Sat 01/01/2005. |
|
Original system clock ± zone-offset outside the daylight saving time range: Original system clock ± zone-offset + summer-offset |
System clock configured: 04:00:00 ss Sat 01/01/2005. |
||
1, 2, 3 or 1, 3, 2 |
date-time ± zone-offset outside the daylight saving time range: date-time ± zone-offset |
02:00:00 zone-time Mon 01/01/2007. |
|
date-time ± zone-offset outside the daylight saving time range: date-time ± zone-offset + summer-offset |
04:00:00 ss Mon 01/01/2007. |
||
2, 3, 1 or 3, 2, 1 |
date-time outside the daylight saving time range: date-time |
01:00:00 zone-time Mon 01/01/2007. |
|
date-time in the daylight saving time range, but date-time – summer-offset outside the summer-time range: date-time – summer-offset |
23:30:00 zone-time Mon 12/31/2007. |
||
Both date-time and date-time – summer-offset in the daylight saving time range: date-time |
03:00:00 ss Tue 01/01/2008. |
Configuration procedure
To change the system time:
Step |
Command |
Remarks |
1. Set the system time and date. |
clock datetime time date |
Optional. Available in user view. |
2. Enter system view. |
system-view |
N/A |
3. Set the time zone. |
clock timezone zone-name { add | minus } zone-offset |
Optional. Coordinated UTC time zone by default. |
4. Set a daylight saving time scheme. |
·
Set
a non-recurring scheme: ·
Set a recurring scheme: |
Optional. Use either command. By default, daylight saving time is disabled, and the UTC time zone applies. |
Enabling displaying the copyright statement
The device by default displays the copyright statement when a Telnet or SSH user logs in, or when a console user quits user view. You can disable or enable the function as needed. The following is a sample copyright statement:
******************************************************************************
* Copyright (c) 2004-2017 New H3C Technologies Co., Ltd. All rights reserved.*
* Without the owner's prior written consent, *
* no decompiling or reverse-engineering shall be allowed. *
******************************************************************************
To enable displaying the copyright statement:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Enable displaying the copyright statement. |
copyright-info enable |
Enabled by default. |
Configuring banners
Banners are messages that the system displays during user login.
The system supports the following banners:
· Legal banner—Appears after the copyright or license statement. To continue login, the user must enter Y or press Enter. To quit the process, the user must enter N. Y and N are case-insensitive.
· Message of the Day (MOTD) banner—Appears after the legal banner and before the login banner.
· Login banner—Appears only when password or scheme authentication has been configured.
· Shell banner—Appears for all login users.
Banner message input modes
You can configure a banner in one of the following ways:
· Single-line input
Input the entire banner in the same line as the command. The start and end delimiters for the banner must be the same but can be any visible character. The input text, including the command keywords and the delimiters cannot exceed 510 characters. In this mode, do not press Enter before you input the end delimiter. For example, you can configure the shell banner "Have a nice day." as follows:
<System> system-view
[System] header shell %Have a nice day.%
· Multiple-line input
Input message text in multiple lines. In this approach, the message text can be up to 2000 characters. Use one of the following methods to implement multi-line input mode:
? Method 1—Press Enter after the last command keyword. At the system prompt, enter the banner message and end with the delimiter character %. For example, you can configure the banner "Have a nice day. Please input the password." as follows:
<System> system-view
[System] header shell
Please input banner content, and quit with the character '%'.
Have a nice day.
Please input the password.%
? Method 2—After you type the last command keyword, type any single character as the start delimiter for the banner and press Enter. At the system prompt, type the banner and end the last line with a delimiter that is the same as the start delimiter. For example, you can configure the banner "Have a nice day. Please input the password." as follows:
<System> system-view
[System] header shell A
Please input banner content, and quit with the character 'A'.
Have a nice day.
Please input the password.A
? Method 3—After you type the last keyword, type the start delimiter and part of the banner and press Enter. At the system prompt, enter the rest of the banner and end the last line with a delimiter that is the same as the start delimiter. For example, you can configure the banner "Have a nice day. Please input the password." as follows:
<System> system-view
[System] header shell AHave a nice day.
Please input banner content, and quit with the character 'A'.
Please input the password.A
Configuration procedure
To configure banners:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Configure the login banner. |
header login text |
Optional. |
3. Configure the legal banner. |
header legal text |
Optional. |
4. Configure the shell banner. |
header shell text |
Optional. |
5. Configure the MOTD banner. |
header motd text |
Optional. |
Configuring the maximum number of concurrent users
You can configure this command to limit the number of users that can enter the system view simultaneously. When the number of concurrent users reaches the upper limit, other users cannot enter system view.
When multiple users configure a setting in system view, only the last configuration applies.
To configure the maximum number of concurrent users:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Configure the maximum number of concurrent users. |
configure-user count number |
By default, up to two users can perform operations in system view at the same time. |
Configuring the exception handling method
You can configure the device to handle system exceptions in one of the following methods:
· reboot—The device automatically reboots to recover from the error condition.
· maintain—The device stays in the error condition so you can collect complete data, including error messages, for diagnosis. In this approach, you must manually reboot the device.
To configure the exception handling method:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Configure the exception handling method for the system. |
system-failure { maintain | reboot } |
By default, the system uses the reboot method when an exception occurs. |
Rebooting the device
|
CAUTION: · Device reboot can interrupt network services. · To avoid data loss, use the save command to save the current configuration before a reboot. · Use the display startup and display boot-loader commands to verify that you have correctly set the startup configuration file and the main system software image file. If the main system software image file has been corrupted or does not exist, the device cannot reboot. You must re-specify a main system software image file, or power off the device and then power it on so the system can reboot with the backup system software image file. |
You can reboot the device in one of the following ways to recover from an error condition:
· Reboot the device immediately at the CLI.
· At the CLI, schedule a reboot to occur at a specific time and date or after a delay.
· Power off and then power on the device. This method might cause data loss, and is the least-preferred method.
Reboot at the CLI enables easy remote device maintenance.
Rebooting devices immediately at the CLI
To reboot a device, execute the following command in user view:
Task |
Command |
Reboot the device immediately. |
reboot |
Scheduling a device reboot
The device supports only one device reboot schedule. If you configure the schedule reboot delay command multiple times, the most recent configuration takes effect. The schedule reboot at command and the schedule reboot delay command overwrite each other, and whichever is configured last takes effect.
For data security, if you are performing file operations at the reboot time, the system does not reboot.
To schedule a device reboot, execute one of the following commands in user view:
Task |
Command |
Remarks |
Schedule a reboot. |
·
Schedule a reboot to occur at a specific time
and date: ·
Schedule a reboot to occur after a delay: |
Use either command. The scheduled reboot function is disabled by default. Changing any clock setting can cancel the reboot schedule. |
Scheduling jobs
You can schedule a job to automatically run a command or a set of commands without administrative interference. The commands in a job are polled every minute. When the scheduled time for a command is reached, the job automatically executes the command. If a confirmation is required while the command is running, the system automatically enters Y or Yes. If characters are required, the system automatically enters a default character string or an empty character string when no default character string is available.
Job configuration approaches
You can configure jobs in a non-modular or modular approach. Use the non-modular approach for a one-time command execution and use non-modular approach for complex maintenance work.
Table 2 A comparison of non-modular and modular approaches
Comparison item |
||
Configuration method |
Configure all elements in one command. |
Separate job, view, and time settings. |
Can multiple jobs be configured? |
No. |
Yes. |
Can a job have multiple commands? |
No. If you use the schedule job command repeatedly, only the last configuration takes effect. |
Yes. You can use the time command in job view to configure commands to be executed at different time points. |
Supported views |
User view and system view. In the schedule job command, shell represents user view, and system represents system view. |
All views. In the time command, monitor represents user view. |
Supported commands |
Commands in user view and system view. |
Commands in all views. |
Can a job be repeatedly executed? |
No. |
Yes. |
Can a job be saved? |
No. |
Yes. |
Configuration guidelines
· To have a job successfully run a command, make sure the specified view and command are valid. The system does not verify their validity.
· After job execution, the configuration interface, view, and user status that you have before job execution are restored even if the job ran a command to change the user interface (for example, telnet, ftp, and ssh2), the view (for example, system-view and quit), or the user status (for example, super).
· The jobs run in the background without displaying any messages except log, trap and debugging messages.
· If you reboot the device, the system time and date are restored to the factory default. To make sure scheduled jobs can be executed at the expected time, you must change the system time and date or configure NTP for the device. For NTP configuration, see Network Management and Monitoring Configuration Guide.
· In the modular approach:
? Every job can have only one view and up to 10 commands. If you specify multiple views, the one specified last takes effect.
? Enter a view name in its complete form. Most commonly used view names include monitor for user view, system for system view, GigabitEthernet x/x/x for Ethernet interface view, and Vlan-interfacex for VLAN interface view.
? The time ID (time-id) must be unique in a job. If two time and command bindings have the same time ID, the one configured last takes effect.
Scheduling a job in the non-modular approach
To schedule a job, execute one of the following commands in user view:
Task |
Command |
Remarks |
Schedule a job. |
·
Schedule a job to run a command at a
specific time: ·
Schedule a job to run a command after a
delay: |
Use either command. If you execute the schedule job command multiple times, the most recent configuration takes effect. Changing any clock setting can cancel the job set by using the schedule job command. |
Scheduling a job in the modular approach
To configure a scheduled job:
Step |
Command |
Remarks |
1. Enter system view. |
system-view |
N/A |
2. Create a job and enter job view. |
job job-name |
N/A |
3. Specify the view in which the commands in the job run. |
view view-name |
You can specify only one view for a job. The job executes all commands in the specified view. |
4. Add commands to the job. |
·
Configure a command to run at a specific time and
date: ·
Configure a command to run at a specific time: ·
Configure a command to run after a delay: |
Use any of the commands. Changing a clock setting does not affect the schedule set by using the time at or time delay command. |
Scheduled job configuration example
Network requirements
Configure scheduled jobs on the AP to enable the interface Radio 1/0/1 at 8:00 and disabled it at 18:00 on working days every week, to control access to the AP.
Figure 1 Network diagram
Configuration procedure
1. Configure the switch:
# Configure the local clock as a reference source. Set the stratum level to 2.
<Sysname> system-view
[Switch] ntp-service refclock-master 2
2. Configure the AP:
# Create a job named pc1, and enter its view.
[Sysname] job pc1
# Enter the view of WLAN-Radio 1/0/1.
[Sysname-job-job1] view WLAN-Radio1/0/1
# Configure the device to enable Radio 1/0/1 at 8:00 on working days every week.
[Sysname-job-job1] time 1 repeating at 8:00 week-day mon tue wed thu fri command undo shutdown
# Configure the device to shut down Radio 1/0/1 at 18:00 on working days every week.
[Sysname-job-job1] time 2 repeating at 18:00 week-day mon tue wed thu fri command shutdown
[Sysname-job-pc1] quit
# Display information about scheduled jobs.
[Sysname] display job
Job name: job1
Specified view: WLAN-Radio1/0/1
Time 1: Execute command undo shutdown at 08:00 Mondays Tuesdays Wednesdays Thursdays Fridays
Time 2: Execute command shutdown at 18:00 Mondays Tuesdays Wednesdays Thursdays Fridays
Clearing unused 16-bit interface indexes
The device must maintain persistent 16-bit interface indexes and keep one interface index match one interface name for network management. After deleting a logical interface, the device retains its 16-bit interface index so the same index can be assigned to the interface at interface re-creation.
To avoid index depletion causing interface creation failures, you can clear all 16-bit indexes that have been assigned but not in use. The operation does not affect the interface indexes of the interfaces that have been created but the indexes assigned to re-recreated interfaces might change.
A confirmation is required when you execute this command. The command will not run if you fail to make a confirmation within 30 seconds or enter N to cancel the operation.
To clear unused 16-bit interface indexes, execute the following command in user view:
Task |
Command |
Clear unused 16-bit interface indexes. |
reset unused porttag |
Displaying and maintaining device management
For diagnosis or troubleshooting, you can use separate display commands to collect running status data module by module, or use the display diagnostic-information command to bulk collect running data for multiple modules.
Task |
Command |
Remarks |
Display the system time and date. |
display clock [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display information about the users that have logged in to the device but are not under user view. |
display configure-user [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the software and hardware copyright statements. |
display copyright [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display CPU usage statistics. |
display cpu-usage [ entry-number [ offset ] [ verbose ] ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display historical CPU usage statistics in charts. |
display cpu-usage history [ task task-id ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display device information. |
display device [ verbose ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the electronic label data for the device. |
display device manuinfo [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display or save running status data for multiple feature modules. |
display diagnostic-information [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display device temperature information. |
display environment [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the configuration of jobs configured by using the job command. |
display job [ job-name ] [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display memory usage statistics. |
display memory [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the mode of the last reboot. |
display reboot-type [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the configuration of the job configured by using the schedule job command. |
display schedule job [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the reboot schedule. |
display schedule reboot [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display the exception handling method. |
display system-failure [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display user interfaces being used. |
display users [ | { begin | exclude | include } regular-expression ] |
Available in any view. |
Display system version information. |
display version [ | { begin | exclude | include } regular-expression ] |
Available in any view. |