Monitor Azure virtual servers via VM extension
Add a monitor via VM extension in Azure and view all your critical metrics in the Site24x7 dashboard. Azure users can now add a Windows or a Linux monitor in a more simplified way without the need to download the agent.
You can add a server monitor via VM extension using one of the three ways:
- Adding a VM extension using the Azure UI portal
- Adding a VM extension via PowerShell
- Adding a VM extension via Azure CLI (Command Line Interface)
Add a VM extension using the Azure UI portal:
- Login to Azure portal
- If you are creating a new VM, navigate to New > Virtual Machines > select any of the Windows/Linux Server apps listed for adding a Windows/Linux monitor
You can also add a new VM by navigating to Resource Groups > Add (+) > Select any of the Windows Server apps listed - In case you already have an existing VM in Azure, navigate to Virtual Machines > select the VM to which you want to add the extension
- Choose deployment model (Classic/Resource) > click Create
- Configure basic settings, size of the VM, and other optional features
- Under Settings blade, go to Extensions > Add Extension (+) > Server Monitoring for Windows/Linux - Site24x7
- To authenticate the Windows/Linux agent, a device key is required. Login to Site24x7 and navigate to Admin > Developer > Device Key in your Site24x7 client. Sign Up if you are a new user.
- Click Create
- Enter the obtained device key in the field provided. Click OK
- You can now view your monitor in the Site24x7 dashboard and start monitoring your critical metrics
Add a VM extension via PowerShell:
Prerequisite:
Make sure the Azure PowerShell SDK is installed and supported from version 2.6 and above
- Login to Microsoft Azure portal by entering the command
Login-AzureAccount - After logging in, execute the command
For Linux server,PS > $vm = (Get-AzureVM -ServiceName <cloudservice name> -Name <vm name>)For Windows server,
PS > Set-AzureVMExtension -ExtensionName Site24x7LinuxServerExtn -Publisher Site24x7 -Version 1.3 -VM $vm -PublicConfiguration '{"site24x7licensekey":"enter your licensekey"}' -ReferenceName <Any extension name>
PS > $vm | Update-AzureVMPS > $vm = (Get-AzureVM -ServiceName <cloudservice name> -Name <vm name>)
PS > Set-AzureVMExtension -ExtensionName Site24x7WindowsServerExtn -Publisher Site24x7 -Version 1.3 -VM $vm -PublicConfiguration '{"site24x7licensekey":"enter your licensekey"}' -ReferenceName <Any extension name>
PS > $vm | Update-AzureVM
Using Azure Resource Manager (ARM):
Please follow the below steps to add a VM extension via PowerShell using ARM:
- Log in to Microsoft Azure portal by entering the command
Login-AzureRmAccount - After logging in, execute the command
For Linux server,Set-AzureRmVMExtension -ProtectedSettingString '{"site24x7LicenseKey":"enter your licensekey"}' -Publisher Site24x7For Windows server,
-ExtensionType Site24x7LinuxServerExtn -Version 1.5 -Name <Any extension name> -ResourceGroupName <resourcegroup name> -Location <location> -VMName <vm name>Set-AzureRmVMExtension -ProtectedSettingString '{"site24x7AgentType":"azurevmextnwindowsserver" , "site24x7LicenseKey":"enter your licensekey"}' -Publisher Site24x7 -ExtensionType Site24x7WindowsServerExtn -Version 1.5 -Name <Any extension name> -ResourceGroupName <resourcegroup name> -Location <location> -VMName <vm name>
- "site24x7LicenseKey" is the Device key that can be obtained from Admin > Developer > Device Key
- The SettingString, Publisher, ExtensionType and the Version in the command string should not be changed
- The user can modify -Name that will be visible in the Extension portal (Settings > Extensions)
For both Classic and ARM models,
Get version and other properties of the extension by executing the following commands:
Get the list of locations:
Remove an extension:
For Linux server,
-ResourceGroupName <resourcegroup name>
For Windows server,
Adding a VM extension via Azure CLI (Command Line Interface):
[Available only for Linux platform]
- For Azure CLI version 1.0, login to Microsoft Azure portal and execute the following command:
azure loginazure vm extension set -g <resource-group-name> --vm-name <vm-name> --version 1.5 --publisher-name Site24x7 -n Site24x7LinuxServerExtn --private-config "{\"site24x7LicenseKey\":\"ab_9868f27c8a45b2fc76088c8ecec7bd7305f59661\"}" --public-config "{\"site24x7AgentType\":\"azurevmextnlinuxserver\"}" - For Azure CLI version 2.0, use the following commands to login and install the vm extension:
az loginaz vm extension set --publisher Site24x7 -n Site24x7LinuxServerExtn -g <resource-group-name> --vm-name <vm-name> --version 1.5 --protected-settings "{\"site24x7LicenseKey\":\"ab_9868f27c8a45b2fc76088c8ecec7bd7305f59661\"}" --settings "{\"site24x7AgentType\":\"azurevmextnlinuxserver\"}"