• 0
TMiller

Powershell results - working with son

Question

Hi everyone,

I'm trying to get some results off a Simplivity system using power shell and json.  I have the powershelgl working as I would expect, but I can't get the results to show up in LogicMonitor. 

In collector debug, I see this when running the script.

>!posh
returns 0
output:
[
    {
        "id":  "53466cdf-ee82-435e-8619-334b3a3e7583",
        "name":  "Fakename",
        "type":  "OMNISTACK",
        "members":  [
                        "4230cce1-f672-e708-0ed6-3310d6db8222",
                        "4230e3c6-4cf6-7228-fc86-cbce8cfa4af7",
                        "564dcac8-b774-c644-cb22-e63acfd07cb9"
                    ],
        "arbiter_connected":  true,
        "arbiter_address":  "10.1.1.6",
        "stored_compressed_data":  731283120128,
        "compression_ratio":  "1.8 : 1",
        "deduplication_ratio":  "300.9 : 1",
        "free_space":  14779864866201,
        "capacity_savings":  387454100800512,
        "efficiency_ratio":  "530.8 : 1",
        "local_backup_capacity":  385825262157824,
        "used_logical_capacity":  388185382895616,
        "remote_backup_capacity":  0,
        "allocated_capacity":  15511146961305,
        "stored_virtual_machine_data":  2360120737792,
        "stored_uncompressed_data":  1290225192960,
        "used_capacity":  731282095104
    }
]

I've attached example of what I've tried for output.  Nothing is showing up.

 

Screen Shot 2017-01-15 at 6.33.33 PM.png

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Because the fundamental JSON datastructure is an array, I believe you'll need to reference the root array element as $[0]. So:

$[0].compression_ratio
$[0].used_capacity
...

 

Share this post


Link to post
Share on other sites
  • 0

I ended up working with support on this.  It turns out that the information coming back from Powershell is actually strings.  I had to use regex to access the data.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.