Network Management

Reply
Regular Contributor I
Posts: 179
Registered: ‎08-29-2008

Airwave CLI Commands

When I got in this morning the Web interface for the AMP server was down, I used to have the command to restart it saved somewhere but I can't find it for the life of me. So I looked up CLI commands for AMP and couldn't find any list of common used commands, is there a reference sheet available?

 

MVP
Posts: 707
Registered: ‎12-01-2010

Re: Airwave CLI Commands

I don't have any such cheat-sheet, and would also like to have the recommended way to do things from Aruba.

 

What I do know is that there are a few scripts titled starting with "amp_"

 

These seem like the likely pair:

amp_disable

amp_enable

 

As a Linux-geek, I'm also likely to use:

shutdown -r now

 

--Matthew

if I've helped, please give kudos
if I've provided a solution, please mark the solution so others can find it
Aruba
Posts: 349
Registered: ‎04-14-2009

Re: Airwave CLI Commands

We probably should find a way to put together a reference of commonly used CLI commands.  Standard linux commands make up a big chunk of what AirWave users do at the CLI.

 

Another command that might help in this case is "ra", which restarts all AMP processes.

 

The most common reason why AMP can't start is a full disk.  You can test that by using the linux command "df"

Regular Contributor I
Posts: 179
Registered: ‎08-29-2008

Re: Airwave CLI Commands

Thanks Matthew, I've already issued the "amp_disable/enable" command but am getting an error.

"Can't use an undefined value as a symbol reference at /usr/local/airwave/lib/perl/Mercury/Utility/AMPEnableDisable.pm line 102."

Apparently AMP is up and running because messages are showing up on the console but the Web interface is down. The last time I used the "shutdown" command the database got corrupted and I had to restore it from backup.

I might have to temp fate again and shut er down. :smileyhappy:

Regular Contributor I
Posts: 179
Registered: ‎08-29-2008

Re: Airwave CLI Commands

Thanks Dan,

 

I issued the "ra" and it gave me the following error...

 

Stopping httpd:                                            [FAILED]
rm: cannot remove `/var/lock/subsys/httpd': Read-only file system
rm: cannot remove `/var/run/httpd.pid': Read-only file system
Starting httpd: /var/log/httpd/error_log.2013-03-04: Read-only file system
                                                           [FAILED]

 

It looks like I have enough drive space too.

 

[root@airwave01 mercury]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                     706827616 104512180 565831548  16% /
/dev/sda1               101086     12816     83051  14% /boot
tmpfs                  8218048         0   8218048   0% /dev/shm

Aruba
Posts: 349
Registered: ‎04-14-2009

Re: Airwave CLI Commands

That means that there's a problem with a disk and/or the linux filesystem.  fsck is a good tool to check for and fix these errors sometimes.  You can run it like this:

 

# shutdown -rF now

 

 

Regular Contributor I
Posts: 179
Registered: ‎08-29-2008

Re: Airwave CLI Commands

Here are some CLI commands that I've discovered, collected, or given that has helped me over the years... Please fee free to add to it.

 

Creating an User Account

  1. useradd [username]
  2. passwd [username]

Changing User's Password

  1. passwd <username>

Granting Someone Temporary Root Access (Like a support person)

Using the SUDO (Super User Doer) command.

  1. Login as root user.
  2. cd /etc
  3. nano sudoers
  4. Scroll down to the section of the file called...
    1. ## Allow root to run any commands anywhere
      root               ALL=(ALL)            ALL
    2. Add  the following to the next line
      <Username> ALL=(ALL)          ALL
  5. Press "CTL o" to save
  6. Press "CTL x" to exit.

List User Accounts

  1. cat /etc/passwd | gawk 'FS=":" {print $1}'

Lock and Unlock a User Account

  1. passwd <username> -l
  2. passwd <username> -u

Shutdown Server

  1. Linux: Shutdown -P now (to power the server off after shutdown)
  2. Linux: shutdown –r now (to restart the server after shutdown)

Editing Files

  1. Edit a File: Vi /path/to/file
  2. Press “i” to enter in “Insert Mode (To leave “Insert Mode” press “esc”)
  3. Delete a character currently under the cursor you must press “x” (you must NOT be in “Insert Mode” because you will insert the letter “x”)
  4. To save (not in “Insert Mode”) press “:x”
  5. If you don’t want to save but want to quit, press “:q” (not in “Insert Mode”)
  6. To search within a file
         To search forward, use “/” and then the word
         To search backward, use “/” and then the word

Show Who Last Logged into the Console and How Long

  1. last

Run a Manual Backup

1. Log into the AWMS system as root.
2. Run the backup script by typing 'amp_backup'.
This creates a backup of the system located in /alternative/databackup.tar.gz.

A good open source Windows file transfer client that supports SFTP and SCP for is WinSCP which is available from http://winscp.sourceforge.net/eng/. WINSCP allows you to transfer the databackup.tar.gz file from your AWMS to your local PC using the secure copy protocol (SCP).

Regular Contributor I
Posts: 179
Registered: ‎08-29-2008

Re: Airwave CLI Commands

Thanks Dan, I ran the command but there was an error on the repair and asked to reboot or go into maintenance mode, I let it reboot and the system wouldn't come up. This is the second time the database has gotten corrupted and I had to restore it. Is there any known issues with database corruption and virtualization?

MVP
Posts: 1,422
Registered: ‎10-25-2011

Re: Airwave CLI Commands

Best bet at this point is to open a support case as they can dive deeper into the issue.

 

If your Airwave is virtualized I would recommend moving it to dedicated hardware or make sure that AMP is the only server runing on your VM. It is insanelly heavy on disk I/O.

 

I have nothing but problems with Airwave on VMWare but we were running other VMs on the cluster. We have since moved to dedicated hardware for it.

Pasquale Monardo | Senior Network Solutions Consultant
ACDX #420 | ACMP
[If you found my post helpful, please give kudos!]
New Contributor
Posts: 1
Registered: ‎11-13-2013

Re: Airwave CLI Commands

Use WinSCP and go to the "/root/svn/mercury/scripts" folder, you'll all the custom AMP command scripts in there

Search Airheads
Showing results for 
Search instead for 
Did you mean: