Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8904577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:10:05+00:00 2026-06-15T02:10:05+00:00

I am building a server dashboard app. I want to take a list of

  • 0

I am building a server dashboard app. I want to take a list of disks from each server and create a list that displays the usage values for each.

Here’s a JSON sample we’re getting back…

    {"server":"webster","disks":[ {"use": "91%", "used": "16G", "mount": "/", "free": "1.6G", "device": "/dev/mapper/vg_f12-lv_root", "total": "18G", "type": "ext4"} ,
{"use": "0%", "used": "0", "mount": "/dev/shm", "free": "500M", "device": "tmpfs", "total": "500M", "type": "tmpfs"} ,
{"use": "22%", "used": "40M", "mount": "/boot", "free": "145M", "device": "/dev/sda1", "total": "194M", "type": "ext4"} ,
{"use": "47%", "used": "52G", "mount": "/rsync", "free": "61G", "device": "/dev/sdb1", "total": "119G", "type": "ext3"} ]}

I get this far with the C# code:

            WebClient c = new WebClient();
            var data = c.DownloadString("http://192.0.0.40:8000/cgi-bin/df.py");
            JObject o = JObject.Parse(data);
            string serv = o["server"].Select(s => (string)s).ToString();
            lblJson.Text = serv;

But I can’t seem to extract “disks” into anything meaningful that I can plugin to a listview. I’ve tried pumping this into IList, but it always crashes or gives me some rude comments from Intellisense.

I do have a class built for this, but haven’t figured out how to port the info into it. For reference, it’s here:

public class drive
    {
        public string Usage;
        public string usedSpace;
        public string Mount;
        public string freeSpace;
        public string Device;
        public string Total;
        public string Type;
    }

Note: The sources for JSON are Linux servers. Windows servers will supply data in a different format ultimately.

And then we have VMWare, but I’ll flail on that later.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T02:10:06+00:00Added an answer on June 15, 2026 at 2:10 am

    There may be a better way to do this, but using the provided drive class, the following works to deserialize your provided JSON:

    JObject o = JObject.Parse(data);
    List<drive> drives = new List<drive>();
    string server = (string)o["server"];
    foreach (var d in o["disks"].Children())
    {
        drives.Add(new drive()
        {
            Usage = (string)d["use"],
            usedSpace = (string)d["used"],
            Mount = (string)d["mount"],
            freeSpace = (string)d["free"],
            Device = (string)d["device"],
            Total = (string)d["total"],
            Type = (string)d["type"]
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a server that loads modules. Each module is a .jar file. Inside
I am building a web app using CakePHP that will allow users to create
I'm building a server in Node.js that receives data from Javascript on a website.
I'm building an client/server-app where I want to sync data. I'm thinking about including
I am building a server app that copies files using System.IO.File.Copy(...) function. My files
I'm building a rack server app that has to filter domains that can access
Suppose that I'm building game server using Erlang. It's very common circulation each user
I'm building a node server that needs to execute code that might be unsafe.
I'm building a server application that needs to perform a lot of http requests
I'm building client/server apllication on QT. I just want user to execute only one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.