forked from marcredhat/dynatrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestdynatraceclicontainer.sh
27 lines (17 loc) · 1.05 KB
/
testdynatraceclicontainer.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
clear
printf "The Dynatrace CLI container was built using https://github.com/marcredhat/dynatrace/blob/master/build.sh"
sleep 4
clear
printf "\n***podman container ls***\n"
podman container ls
dynatraceclicontainer=`podman container ls | grep dynatracecli | awk '{print $1'}`
printf "==============================================================="
printf "\nRunning commands inside the Dynatrace CLI container using podman\n"
printf "==============================================================="
printf "\n***Display my OpenShift nodes using Dynatrace CLI***\n"
podman exec -i $dynatraceclicontainer '/bin/sh' -c 'python3 dynatrace-cli/dtcli.py ent host .*ocp*. displayName'
printf "\n***Display the IP addresses of my OpenShift nodes using Dynatrace CLI***\n"
podman exec -i $dynatraceclicontainer '/bin/sh' -c 'python3 dynatrace-cli/dtcli.py ent host .*ocp*. ipAddresses'
printf "\n***Display applications using Dynatrace CLI***\n"
podman exec -i $dynatraceclicontainer '/bin/sh' -c 'python3 dynatrace-cli/dtcli.py ent app .*web*. displayName'