Tag Archives: port

Unifi Controller Start-up Failed

When starting up your UniFi controller on your server, you might be prompted with the error saying “Start-up failed” as the screenshot below.

Some might manage to see that the application says that Port 8443 is in use by another application. Some CCTV applications or other web applications installed on the server would use the same port.

Here you would have two choices, you can uninstall the conflicting application or just change the port of the UniFi controller.

To change the port of the UniFi controller, you need to open the system.properties file from C:\Users\<user name>\Ubiquiti UniFi\data.

Remove the hash from the below lines and change the port to 8445 and both lines should be as below.

unifi.https.port=8445
portal.https.port=8445

Save the file and close Notepad. Open the UniFi Controller and the issue will be resolved and the service will start with no issues.

 

 

(319)

How to: Check if port is open with Powershell

For sys admins it is important to know if ports of certain applications are open for monitoring. One simple solution is to have a monitoring software, but if you want a cheap and cheerful solution, you can use Powershell. This can be done by the below script.

The below script will check the server/port and if the port is open, it will just print on screen saying “PORT IS OPEN – OK” and if the port is not open or the service is down, it will send and email.

Feel free to change or add to this script. You can easily put this in a loop to check all the services in your enterprise.

#PARTS THAT CAN BE CHANGED
$MailServer = "mail.mydomain.com"
$MailTo = "sysadmin@mydomain.com"
$MailFrom = "IT <noreply@mydomain.com>"
$MailBody = "Please note that the server is not reachable in this test that runs every 10 minutes. Please check the status of the server."
$MailSubject = "** PORT IS NOT REACHABLE FOR SERVER 1 **"
$Server = "SQLSRV01"
$Server_port = "1433"
#PARTS THAT CAN BE CHANGED

$socket = New-Object Net.Sockets.TcpClient
$ErrorActionPreference = 'SilentlyContinue'

#Server and port
$socket.Connect($Server,$Server_Port)
$ErrorActionPreference = 'Continue'

if ($socket.Connected) {
Write-Host "POST IS OPEN - OK"
$socket.Close()
}
else
{
send-mailmessage -To $MailTo -from $MailFrom -Subject $MailSubject -body $MailBody -smtpserver $MailServer -BodyAsHtml -Encoding ([System.Text.Encoding]::UTF8)
}

$socket = $null

(762)