Tuesday, July 15, 2014

How to Migrate Ubiquiti Unifi AP to a New Controller


How to Migrate Ubiquiti Unifi AP to a New Controller
Prerequisites:
    1.    determine the IP address of the access point, you can scan the network looking for it
    ▪    nmap 192.168.42.0/24 |grep Ubiquiti -B 5
    ▪    nmap 192.168.42.0/24 -p 22 -oG - |grep open
    2.    be logged in to the new Unifi Controller website
Steps:
    1.    ssh into the access point using the admin credentials the current controller software uses (typically “admin” for the username and whatever password is assigned). For example: ssh admin@192.168.42.71
    2.    reset the AP to the system defaults by running “syswrapper.sh restore-default”. The AP will  then reboot.
    3.    about 20 seconds after reboot, ssh into the access point again using the ubiquiti default username: “ubnt” and password: “ubnt”.
    4.   after logging in type “mca-cli” and hit Enter
    •    at the UniFi# prompt type “set-inform http://<ip address or domain name>:8080/inform” and hit Enter
Browse to the Ubiquiti Unifi controller website - https://<ip address or domain name>:8443. Before running the set-inform command, it should show 0 pending devices: but afterwards, it should show 1 pending device:
Click on the link of the MAC address of the pending access point to adopt the device and click the adopt button.
The state of the access point will change to “Adopting”. Wait until the state changes to “Disconnected” before moving on to the next step.
After the state shows disconnected, wait 1 more minute and then go back to your ssh session and run the set-inform command again
    •    set-inform http://<ip address or domain name>:8080/inform
    •    type “exit” to leave the mca-cli utility
Monitor the progress of the rest of the migration from the controller website. Within seconds of running the set-inform command the second time, you should see the status of the AP change to “Upgrading” (if a firmware update is applicable) and then to “Provisioning”. After a minute or two, you should see the final status of “Connected”.
Last step is to go to the Configuration tab of the AP in the controller website and assign it an alias name that will make it easier to track.


reference:

http://helpdesk.maytechgroup.com/support/articles/3000008280-how-to-move-a-ubiquiti-unifi-access-point-to-a-new

Thursday, June 19, 2014

How to find the serial ports on Mac OS X?

This example is for Trendnet USB to serial adapter v2

After install del driver for your Mac and restart the Mac.

Open a terminal session and type.

#ls /dev/tty.*

note the list of the usb-serial com port per example

/dev/tty.usbserial (in my case)

Then use screen commandon the terminal in order to access your serial appliance, per example

#screen /dev/tty.usbserial {baudrate}


USEFUL ORACLE SQL QUERIES ON TNS


Oracle 11g how to get tables names that contain a columns name

SELECT TABLE_NAME
FROM ALL_TAB_COLUMNS
WHERE COLUMN_NAME = 'STRING THAT YOU ARE LOOKING FOR'

Find out IP addresses for CRUs

SELECT *
FROM SCEMAIN;




Monday, May 19, 2014

backup and restore extreme switch configuration file using mac tftp server

http://www.youtube.com/watch?v=g3e52b6N3zE

On the Mac Server

download TFTP server for mac.
http://www.macupdate.com/app/mac/11116/tftpserver

after installed change the path to a local user to fix working path permission.
the default tftpd path is set on the tftp.plist file and needs to be change

make sure firewall is not blocking default 69 UDP tftp port.

Also create a file with the same name of the backup configuration file that you will assign on the switch on the next step, prior tftp put command execution.
On this example primary_223backup.cfg


On the Extreme switch
show switch command will display the configuration filename that the switch is using as a primary configuration and booted file.

X450a-48t-223.2 # show switch

SysName:          X450a-48t-223
SysLocation:
SysContact:       support@extremenetworks.com, +1 888 257 3000
System MAC:       00:04:96:27:90:8B
System Type:      X450a-48t

SysHealth check:  Enabled (Normal)
Recovery Mode:    All
System Watchdog:  Enabled

Current Time:     Mon May 19 11:53:44 2014
Timezone:         [Auto DST Disabled] GMT Offset: 0 minutes, name is UTC.
Boot Time:        Wed Mar 13 14:30:34 2013
Boot Count:       23
Next Reboot:      None scheduled
System UpTime:    431 days 21 hours 23 minutes 9 seconds

Current State:    OPERATIONAL
Image Selected:   primary
Image Booted:     primary
Primary ver:      12.0.1.11
Secondary ver:    11.5.2.10

Config Selected:  primary.cfg
Config Booted:    primary.cfg

primary.cfg       Created by ExtremeXOS version 12.0.1.11
                  154613 bytes saved on Thu Apr 24 17:06:20 2014

X450a-48t-223.1 # ls
-rw-r--r--    1 root     0            2775 Nov  1  2007 Restrict_NMS.pol
-rw-rw-rw-    1 root     0          154613 Apr 24 17:06 primary.cfg

 1k-blocks      Used Available Use%
     16384       480     15904   3%

save configuration command will copy the primary configuration file to another filename.

X450a-48t-223.4 # save configuration primary_223backup
Do you want to save configuration to primary_223backup.cfg? (y/N) Yes
Saving configuration on master ........ done!
Configuration saved to primary_223backup.cfg successfully.

The current selected default configuration database to boot up the system
(primary.cfg) is different than the one just saved (primary_223backup.cfg).
Do you want to make primary_223backup.cfg the default database? (y/N) No
Default configuration database selection cancelled.

tftp command will save the backup configuration file into the TFTP server.

X450a-48t-223.6 # tftp 10.7.40.253 -v vr-default -p -l primary_223backup.cfg
Uploading primary_223backup.cfg to 10.7.40.253 ... done!

use tftp command to restore the backup configuration file back into the switch

X450a-48t-223.7 # ls
-rw-r--r--    1 root     0            2775 Nov  1  2007 Restrict_NMS.pol
-rw-rw-rw-    1 root     0          154613 Apr 24 17:06 primary.cfg
-rw-rw-rw-    1 root     0          154613 May 19 11:54 primary_223backup.cfg

 1k-blocks      Used Available Use%
     16384       504     15880   3%

X450a-48t-223.8 # rm primary_223backup.cfg
Remove primary_223backup.cfg from switch? (y/N) Yes

X450a-48t-223.9 # ls
-rw-r--r--    1 root     0            2775 Nov  1  2007 Restrict_NMS.pol
-rw-rw-rw-    1 root     0          154613 Apr 24 17:06 primary.cfg

 1k-blocks      Used Available Use%
     16384       504     15880   3%

X450a-48t-223.10 # tftp 10.7.40.253 -v vr-default -g -l primary_223backup.cfg
Downloading primary_223backup.cfg to switch.... done!
X450a-48t-223.11 # ls
-rw-r--r--    1 root     0            2775 Nov  1  2007 Restrict_NMS.pol
-rw-rw-rw-    1 root     0          154613 Apr 24 17:06 primary.cfg
-rw-r--r--    1 root     0          154613 May 19 12:16 primary_223backup.cfg

 1k-blocks      Used Available Use%
     16384       528     15856   3%



Wednesday, April 23, 2014

The BSD syslog Protocol

http://tools.ietf.org/html/rfc3164

configure syslog on extreme switches


If you want to send your Extreme Switch syslogs over to a remote syslog server you can do it with the following commands:
SSH or telnet to your switch and login with username and password.
?
1
2
3
4
5
conf syslog add 192.168.0.1:514 vr "VR-Default" local0 <enter>
enable log target syslog 192.168.0.1:514 <enter>
save <enter>
y <enter>
exit <enter>
Replace 192.168.0.1 with the IP of your syslog server and port 514 if the server doesn’t listen for incoming traffic on port 514.
If your using a LogLogic server your device will appear in the devices list. I have no experience of other syslog servers so they may need to be setup to log the traffic but this is all you need to do on the extreme end.

Monday, April 14, 2014

Configuring RAID 1 on MAC OSx Server


Jul 30, 2011 3:00 AM (in response to ideelist)
I found the basic principle on another forum thanks to a guy called 'e-whizz' and this what I did to make RAID 1 work on a mac mini server with LION server.

You can easily configure the second drive on a mac mini server for a Mirrored RAID 1 set with Lion Server without either reinstalling or erasing your existing setup.
The initial setup process takes about 30 minutes, though the rebuilding of the mirror disk will take several hours, depending on the amount of data you have on the drive. It took around 3 hours on a new mac mini server with lion server installed, nothing else configured.

Before you start, please ensure you have a current backup of the server. Getting the following commands wrong can render you server unusable.

What you need to use is the command line version of Disk Utility, diskutil.

Before you start, clone the hard drive. You can use SuperDuper (or similar, I have used SuperDuper) with copying all files onto a USB memory stick. If Lion is freshly installed, 8Gb will do. SuperDuper will create a bootable copy on the USB.

Boot the mac mini from the external USB. To do that, reboot and hold down the option key while restarting. You will see a window, select the USB drive to boot from.

Launch the terminal and type the following command:
diskutil list

This gives you a list of all the drives and partitions your system knows about.
You need to find the Server HD partition (the first disk) and the HD2 partitions (the second disk). These are the two main ~500GB drives. You will be using the disk IDENTIFIERs when issuing the diskutil commands. For a stock standard Mac Mini Server, the commands below are correct, but if you have previously changed the volume names, or repartitioned at any stage the disk identifiers and volume names may differ.

First enable RAID mirroring on existing Server HD volume. This will create a single disk, unpaired mirror, without affecting your data.

Using this syntax:
diskutil appleRAID enable mirror disktomirror
where disktomirror is your disk identifier for Server HD

On my mac mini server, Server HD was disk0s2, so I used this command:
diskutil appleRAID enable mirror disk0s2

You now need to run diskutil list again to see the disk identifier for the new RAID volume. The new RAID volume will be listed as disk# on its own at the bottom of the list.
On my mac mini server this was disk3 (disk 2 was the USB I booted from, disk 0 the first disk and disk 1 the second disk)

Next add the disk HD2 to the Server HD raid mirror volume (on my mac, as I said before, this is disk3) as a new member.

This step will erase disk HD2 and begin an auto repair of the Server HD.

Using this syntax:
diskutil appleRAID add member newdisk raidvolume
replacing newdisk and raidvolume with your particular disk identifiers

On my server this was:
diskutil appleRAID add member disk1s2 disk3


To follow the progress of rebuilding the mirror set, type
diskutil list
It will show you the progress in % of the rebuilding under status

Once finished, reboot and your RAID 1 is up and running and you have also a working backup on your USB (coz' that's where you booted from ;-)

After reboot you can check the status of your RAID with
diskutil appleRAID list
Both drives should show ONLINE under status, interestingly, the device node for the RAID changed on my mac mini server from disk3 to disk2


That's it