Tuesday, June 12, 2007

PatrolCli - a powerful tool for Patrol Admins

PatrolCli is a command line program based on the PATROL application program interface that executes on all PATROL Agent platforms toprovide access to the features and functions of a PATROL Agent. PatrolCli is designed to connect to a PATROL Agent in instances when aGUI interface is unavailable, the user is logged into a host via a terminal emulator (without a TCP/IP stack), or using a developer console couldaffect production agents.

You can use PatrolCli to do the following:
• Access PATROL Agents on all platforms.
• Read PATROL objects from the PATROL Agent (the PATROLobjects are also available in the PATROL SNMP MIB).
• Read and send, acknowledge, or close PATROL events.
• Execute PSL scripts that have been pre-defined in the PATROL Agent or are sent directly from PatrolCli.

I have been using patrolcli to gather information from different agents.
Infact we created a site to give more information on the agent.

Here few trips and tricks using patrolcli interface.

A) In Patrol 7 architecture execute the following PSL to get the following information -

1) PSL to get the RT SERVER INSTANCES
print(get("/PHM_RTSERVER/instances"));

2) PSL to print total number of agents connected to a particular RT SERVER
print(get("/PHM_RTSERVER//numConnectedAgents/value"));

3) PSL to print the agents connected to all the clouds
print(get("/PHM_AGENT/instances"));

B) Patrolcli command to send message -

$PATROL_HOME/bin/PatrolCLI "${Patrol_User}" "${Patrol_Connect}" "${Patrol_Event}
"Message text"

Where:Patrol_User="user patrolaccount patrolpassword"

Patrol_Connect="connect servername port#"
(servername=short hostname of a server Patrol Agent is running on. Port # of that Patrol agent)

Patrol_Event="event send STANDARD 41 WARNING 3"

C) Command to view a file on a remote agent.
Create a psl file - a.psl with the following psl commands
lst=system("type\\ c:\\a.txt"); <--- windows filesystem
lst=system("cat /apps/a.tx"); <--- *NIX filesystem
print(lst);
and execute the Patrolcli with the following command.
execpsl -f a.psl

If you need any more information please refer to the BMC document - PATROL®Command LineInterfaces Reference Manual -http://documents.bmc.com/supportu/documents/02/68/10268/10268.pdf

No comments: