Longitude Command Line

The Longitude Command Line tool can be used to configure Heroix Longitude to start, stop, suspend and resume application monitoring, to add computers to groups, and to list computers by group or by monitored application.

The Longitude Command Line tool has limited error checking so we strongly recommend verifying command syntax by viewing command results in the Longitude Web UI before using Longitude commands in scripts intended to automate monitoring actions.

Installation

  1. Install Longitude 10.1 or upgrade to Longitude 10.1.
  2. Longitude commands can be run from either the Longitude Management Console, or from a remote computer. If you would like to run Longitude commands from a remote computer, the computer requires:
    • Windows computer
    • Jave version 7 or higher
    • Ability to make an RPC connection to the Longitude Management Console. Generally, this means that there should be no firewall between the Longitude command line computer and the Longitude Management Console.
  3. Copy the entire Longitude\LongitudeCommand folder on the Longitude Management Console to c:\LongitudeCommand on the computers you will be using to run the Longitude commands. This folder must be copied to c:\ regardless of whether you are running commands on the Longitude Management Console or a remote computer.
  4. (Optional): Longitude commands must include the name of the Longitude server, a Longitude user with Admin rights, and that user’s password. Default settings for these values can be specified in the c:\LongitudeCommand\longitude_command.defaults file.

Technical Notes

  1. Argument values are case sensitive.
  2. The longitude command is a .bat file, so if you are scripting with a batch file you will need to execute it using “CALL”, e.g. “CALL longitude monitor /a Windows /c windows1.test.net”.

Longitude Command Syntax

longitude <action>   <arguments>   <server>

Longitude <actions> are one of the following with additional action specific <arguments>:

monitor Monitor an application on a computer/group
remove Remove monitoring of an application for a computer/group
remove_all Remove all application monitoring for a computer/group
suspend Suspend all application monitoring for a computer/group
resume Resume application monitoring for a computer/group
group Add a computer to a group and create the group if it does not exist
list_in_app List all computers being monitored by a specified application
list_suspended List all suspended computers
list_groups List all group names
list_in_group List all the computers in a group

<server>

This section specifies the Longitude Management Console being updated, a Longitude admin account, and the password for that account. Note that these arguments may be omitted if their values are specified in c:\LongitudeCommand\longitude_command.defaults

/s     <Longitude server>
/u     <Longitude username>
/p     <Longitude password>

Actions

Monitor – Monitor a Longitude application on a computer or group.

SYNTAX:     longitude monitor [arguments]

[arguments]:

/c <computer> or /g <group>

Specify either the computer (/c) or group (/g) on which the application will be monitored. Both /c and /g cannot be used in the same command.

/a <application>

The name of the application to be monitored (see Application Properties document for full list of applications)

/i <instance>

Specify the instance for applications that can include multiple instances, e.g. SQL2016 or UnixScript Transactions.

/t <transaction type>

If the command is registering a Transaction then the type of transaction must be specified.

/props <application properties>

  • See Application Properties document for required and optional properties for each application.
  • The format for the application properties is:
    /props “Name1:Value1,Name2:Value2,…,NameN:ValueN”
  • Property names and values are case sensitive.
  • Only use commas between properties – spaces are not allowed.
  • Values containing commas must be enclosed by parenthesis, e.g.:
    /props “LogFile:Application,Type Allow List:(Error,Warning),Event Allow List:(5,100,3000)”

/r <remote agent>

(Optional) Specifies a Longitude remote agent which will collect data for the computer being monitored. If /r is not used, data will be collected by the Longitude server. Note that when an application is first monitored on a computer the agent used for that application will be used for all other applications and the /r option will be ignored.

/suppress_dns

(Optional) When setting up monitoring Longitude will attempt to resolve specified computer names to fully qualified domain names. Specifying /suppress_dns will register the computer under the name specified in the /c argument.

Examples:

NOTE: For details on required application properties, consult the Longitude Command Line Application Properties document.

  1. Monitor Windows on computer Windows1.local.net:
    longitude monitor /a Windows /c Windows1.local.net
  2. Monitor Unix on computer Linux1.test.net with username “service” and password “pwd” using remote agent “linuxmon.test.net”:
    longitude monitor /a Unix /c Linux1.test.net /r linuxmon.test.net
    /props “Username:service,Password:pwd”
  3. Monitor PingCritical transaction for group UnixComps:
    longitude monitor /a Transaction /t PingCritical /g UnixComps
  4. Monitor HttpUrl transaction for computer www.heroix.com:
    longitude monitor /a Transaction /t HttpUrl /i mainurl /c www.heroix.com
    /props “URL:https://www.heroix.com/,Path:/,Protocol:https”
  5. Monitor SQL2014 application for SQL instance named “Heroix” on computer sql.test.net:
    longitude monitor /a SQL2014 /c sql.test.net /i Heroix
    /props “NamedInstance:Heroix,Database Driver:net.sourceforge.jtds.jdbc.Driver,Database URL:jdbc:jtds:sqlserver://sql.test.net;integratedSecurity=true;instance=Heroix;”
  6. Monitor SQL2016 application for default SQL server 2016 instance on computer sql1.test.net:
    longitude monitor /a SQL2016 /c sql1.test.net
    /props “Database Driver:net.sourceforge.jtds.jdbc.Driver,Database URL:jdbc:jtds:sqlserver://sql1.test.net;integratedSecurity=true;”
  7. Monitor Oracle instance inst1 on sql.test.net:
    longitude monitor /a Oracle /c sql.test.net /i inst1
    /props “Oracle Instance:inst1,Oracle User:admin,Password:password”
  8. Monitor Windows Application Event Log for all computers in group “test” using instance name “Application”. Only collect Error and Warning events with Event ID 5:
    longitude monitor /a WindowsEventLog /g test /i Application
    /props “LogFile:Application,Type Allow List:(Error,Warning),Event Allow List:5”
  9. Monitor Windows Application Event Log for all computers in group “test”, using instance name “Application”. Only collect Error events for Event IDs 5,100, and 3000.
    longitude monitor /a WindowsEventLog /g test /i Application
    /props “LogFile:Application,Type Allow List:Error,Event Allow List:(5,100,3000)”

Remove – Remove monitoring for a Longitude application from a computer or group.

SYNTAX:     longitude remove [arguments]

[arguments]:

/c <computer> or /g <group>

Specify either the computer (/c) or group (/g) on which the application will be removed. Both /c and /g cannot be used in the same command.

/a <application>

The name of the application to be removed (see Application Properties document for full list of applications)

/i <instance>

Specify the instance for applications that can include multiple instances, e.g. SQL2016 or UnixScript Transactions. If you are removing a transaction, specify only the transaction’s unique instance name instead and do not specify the Transaction Type (/t). For example, to remove the Ping transaction for the group “test”:

longitude remove /a Transaction /i Ping /g test

Remove_all – Remove all Longitude application monitoring from a computer or group.

SYNTAX:     longitude remove_all [arguments]

[arguments]:

/c <computer> or /g <group>

Specify either the computer (/c) or group (/g) on which the applications will be removed. Both /c and /g cannot be used in the same command.

Suspend – Suspend all Longitude application monitoring for a computer or group.

SYNTAX:     longitude suspend [arguments]

[arguments]:

/c <computer> or /g <group>

Specify either the computer (/c) or group (/g) on which all application monitoring will be suspended. Both /c and /g cannot be used in the same command.

Resume – Resume Longitude application monitoring for a computer or group.

SYNTAX:     longitude suspend [arguments]

[arguments]:

/c <computer> or /g <group>

Specify either the suspended computer (/c) or group (/g) of suspended computer on which application monitoring will be resumed. Both /c and /g cannot be used in the same command

Group – Add a computer to a group and create the group if it does not exist.

SYNTAX:     longitude group [arguments]

[arguments]:

/c <computer>

The computer to be added to the group.

/g <group>

The group to which the computer will be added. If the group does not exist, it will be created.

List In App – List all computers being monitored with a specified Longitude application.

SYNTAX:     longitude list_in_app [arguments]

[arguments]:

/a <application>

The application to be scanned for monitored computers.

/t <transaction-type>

The transaction-type to scan for monitored computers when the application is Transaction.

List Suspended – List all suspended computers.

SYNTAX:     longitude list_suspended

List Groups – List all group names.

SYNTAX:     longitude list_groups

List in Group – List all computers in a group.

SYNTAX:     longitude list_in_group [arguments]

[arguments]:

/g <group>

Group name to scan for member computers.