Longitude 10.1 introduces the new Longitude Command Line Interface (CLI). The Longitude CLI complements the Longitude Web Interface (Longitude Console) with new scripting capabilities that can be used to automate Longitude’s monitoring behavior.
Like the Longitude Console, the Longitude CLI is easy to master and lightweight. The Longitude CLI provides the following administrative capabilities:
- Add/remove application monitoring for a computer or group
- Suspend/Resume monitoring for a computer or group
- List all computers monitored by an application
- Add a computer to a group
- List all suspended computers
- List all groups or all computers in a group
The Longitude CLI works by providing commands that interact with the Longitude Console. Since the Longitude CLI can be run from a command prompt, it can be easily be incorporated into any script that can run Windows commands - e.g. batch files or Powershell.
|Figure 1: Longitude CLI initiating the monitoring of a Windows Server|
Adding server appropriate monitoring can now be implemented as a step in building a new server. The Longitude CLI, allows users to easily incorporate Longitude's built-in knowledge base as part of any server build script.
For example (Figure 1), the Longitude CLI can automate as follows:
Server Discovery and Monitoring using PowerShell
The Longitude Console includes built-in device discovery and monitoring that detects servers and network devices via network scanning. The Longitude CLI allows you to expand device discovery with scripts using customized criteria.
|Example 1 – Monitor all the Windows Servers in a Windows Domain|
The PowerShell Script in Example 1 scans an Active Directory domain controller for computers with "Server" as part of their Operating System name. All computers in this list are then configured to be monitored using Longitude's built-in knowledge base for Windows.
|Example 2 – Monitor all Windows devices in an OU|
The PowerShell Script in Example 2 once again scans through Active Directory, but in this case it will look at the computer's DistinguishedName to check if it contains a specified organizational unit (OU) string. Any computers that match this string (e.g. "OU=Development", or "OU=Production") will be added to the results which are then be monitored using Longitude's built-in knowledge base for Windows.
|Figure 2: Longitude CLI stopping the monitoring of a Windows Server|
Organizations where the server and network device counts are volatile can employ scripts with the Longitude CLI to take devices temporarily off line (from monitoring) or permanently remove them from being monitored altogether.
The “suspend” command is very helpful in situations where a server and or its application are taken temporarily off line and you want Longitude to simply stop collecting and evaluating key metrics until the monitoring is reinstated later on either via the Longitude CLI ‘s “resume” command or user configuration via the Longitude Console.
The Longitude CLI is quite easy to master, for additional detail on the Longitude CLI please consult the online help.
Longitude CLI Tutorial