
If you work in an environment were it is common that there are more than 1 person in a device at a given time or you notice there are other people logged in when you are going to be doing some intrusive maintenance it may be beneficial to send a message to that other person to let them know. A quick and dirty way to do this is directly from the command line itself using the ‘send’ command.
First you will want to check to see if another user is logged in and how they are logged in (vty, console) to do this you will use the show users command.
1 2 3 4 5 6 7 8 |
Cisco-3750x# show users Line User Host(s) Idle Location 1 vty 0 user1 idle 00:00:09 192.168.1.55 * 2 vty 1 user2 idle 00:00:00 192.168.1.120 Interface User Mode Idle Peer Address Cisco-3750x# |
So I can see that I am user 2 because I have the “*” on my line, and I see that user1 is logged into vty0, so I can send a message directly to that terminal by issuing the command below.
1 2 3 4 5 6 |
Cisco-3750x# send vty 0 Enter message, end with CTRL/Z; abort with CTRL/C: Hey I see you are logged in too! ^Z Send message? [confirm] Cisco-3750x# |
send vty 0 : Sends a message to the vty 0 channel
After hitting enter I am prompted to enter a message.
I enter the message and hit control + z to exit and send the message
Hit enter to confirm
And If we look at the console of user1 we can see the message come through.
1 2 3 4 5 6 7 8 9 10 11 |
Cisco-3750x# *** *** *** Message from tty2 to tty1: *** Hey I see you are logged in too! Cisco-3750x# |
So now user1 and user2 could communicate back and forth via this method, now lets say I am again user2 and want to send a message to every terminal on the system because I am about to reboot the device. Rather than sending a message to each logged in user (if there are more than 2) I can send a broadcast and below is an example of doing that, note the command is ‘send *’.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
Cisco-3750x# send * Enter message, end with CTRL/Z; abort with CTRL/C: Rebooting system in 5 minutes! If this is unacceptable issue the command 'send vty 1' to notify me and I will halt the reboot. ^Z Send message? [confirm] Cisco-3750x# *** *** *** Message from tty2 to all terminals: *** Rebooting system in 5 minutes! If this is unacceptable issue the command 'send vty 1' to notify me and I will halt the reboot. Cisco-3750x# |
As you can see the message also appeared on my own terminal because it has been broadcasted to the entire system, now I know that anyone logged into the system knows my plan to reboot and knows a way to contact me in the event they need me to wait.
Leave a Reply