Asking for some help, as I have been getting nowhere with this all day...
I have a variable called $text, populated from a Sciencelogic API, which looks like:
echo $text
/api/device/9767/aligned_app/6B2C342727896B9BED64AC156E55B7E0 : @{app_name=VMware: VirtualMachine Configuration; thresholds=}
/api/device/9767/aligned_app/E28ED8DD41A89F3607DF8A204FF0475E : @{app_name=VMware: VirtualMachine CPU Performance; thresholds=}
/api/device/9767/aligned_app/660405AB28B347B968862DDF0D788C00 : @{app_name=VMware: VirtualMachine Datastore Performance; thresholds=}
/api/device/9767/aligned_app/96AD6BCF5EE58CC5CECC2DC17CE818AD : @{app_name=VMware: VirtualMachine Disk Performance; thresholds=}
/api/device/9767/aligned_app/E0326A53EFDCDD3BF395904B0F640D1B : @{app_name=VMware: VirtualMachine Memory Performance; thresholds=}
/api/device/9767/aligned_app/37AB770954C374322E321C93F8061662 : @{app_name=VMware: VirtualMachine Network Performance; thresholds=}
/api/device/9767/aligned_app/9B20E399FDCE3C4AD06769A7DA54047B : @{app_name=VMware: VirtualMachine Storage Performance; thresholds=}
/api/device/9767/aligned_app/3626E5EB5D83AF6EBAEF53F157E5904B : @{app_name=VMware: VirtualMachine Uptime Performance; thresholds=}
With the first number after device in the name being the device ID ($did) and the last string aligned_app ID ($appid). The variable $did is unique for every device and there are two $appid values.
To drill down into this data, I need to call a rather awkward variable name, such as:
echo $text.'/api/device/9767/aligned_app/E0326A53EFDCDD3BF395904B0F640D1B'
app_name thresholds
-------- ----------
VMware: VirtualMachine Memory Performance @{100=; 201-5=; 201-8=; 201-6=}
And ultimately the threshold value I am after:
echo $text.'/api/device/9767/aligned_app/E0326A53EFDCDD3BF395904B0F640D1B'.thresholds.100
name setting
---- -------
Physical Memory Utilization High 98.000
Now the problem I have is that the $text is called in a foreach loop, where the IDs change. So what I really want to call is:
$did = 1234
$appid = "E0326A53EFDCDD3BF395904B0F640D1B"
$thresholds = $text.'/api/device/$did/aligned_app/$appid'.thresholds.100
But however I have tried I can't retrieve $text.'/api/device/$did/aligned_app/$appid'.thresholds.
I can as a string, but not as a 'call' to the data it holds, if you get my drift.
I am not sure how to describe this problem and better, to form a sentence which I can search the web for, so hoping someone her can assist.