Code loop through a range of IPs and query McAfee epo on client machines
# Loop through IP address 10.0.0.10 - 10.0.0.20 and print out
# the computer name and the agent version
echo "" > output;
for ((i=10;i<=20;i++))
do
# -s Silent Curl
# -m 1 Wait no longer than 1 second per host
curl -s -m 1 "http://10.0.0.${i}:8081/LoadProductNames" >> output
done
jq "[.[] | { Agent: .AgentHostName, Version: .Version }]" output | grep -v "null" | grep -A 1 "Agent"
Sample Output
"Agent": "computer01",
"Version": "5.5.1.388"
--
"Agent": "computer02",
"Version": "5.5.1.388"
--
"Agent": "computer03",
"Version": "5.5.1.388"
--
"Agent": "computer04",
"Version": "5.5.1.388"
--
"Agent": "computer05",
"Version": "5.5.1.388"