A common question seen in Support is some variation of "How can I tell how many agents are defined in Autosys?"
There is no Autosys command to count the number of agents but there is a way to find out this number using a combination of methods (depending on your platform). Below are a few ways to determine the number of agents defined in the AEDB for a particular CA Workload Automation AE Environment:
UNIX
1. To get a listing of all your agents, run this command from your Autosys server and pipe the results to a file: autorep -M ALL > /tmp/machine_count
The file would look something like this:
Machine Name Max Load Current Load Factor O/S Status
________________________________________________________________________________ __________ ____________ _______ ___________ ______
localhost --- --- 1.00 Sys Agent Online
localhost2 --- --- 1.00 Sys Agent Online
localhost3 --- --- 1.00 Sys Agent Online
2. Use the “nl” command to count the number of lines in the file:
[root@localhost tmp]# nl machine_count
1 Machine Name Max Load Current Load Factor O/S Status
2 ___________________________ ____________ _______ ___________ ______
3 localhost --- --- 1.00 Sys Agent Online
4 localhost2 --- --- 1.00 Sys Agent Online
5 localhost3 --- --- 1.00 Sys Agent Online
NOTE: Be sure you subtract 2 from the line count – the first 2 lines are not part of the agent count.
WINDOWS
1. To get a listing of all your agents, run this command (from your Autosys command prompt) and pipe the results to a file: autorep -M ALL > C:\Temp\machine_count.txt
The file would look something like this:
Machine Name Max Load Current Load Factor O/S Status
________________________________________________________________________________ __________ ____________ _______ ___________ ______
localhost --- --- 1.00 Sys Agent Online
localhost2 --- --- 1.00 Sys Agent Online
localhost3 --- --- 1.00 Sys Agent Online
2. Use the “find” command to count the number of lines in the file:
C:\Temp>find /C "Agent" C:\Users\Administrator\Documents\machine_count.txt
---------- C:\USERS\ADMINISTRATOR\DOCUMENTS\MACHINE_COUNT.TXT: 3
SQL QUERY
1. Run the following query against the Autosys Database (AEDB)
Oracle: select count(distinct mach_name) "Number of Machines" from aedbadmin.ujo_machine;
Number of Machines
------------------
3
SQL: select count(distinct mach_name) "Number of Machines" from dbo.ujo_machine;