Page 1 of 1

API string for status

Posted: Tue Jun 06, 2017 10:46 am
by NetonixUser
I'm making a php monitor the status of our Netonix switches.

I want to pull off uptime, CPU, memory, Firmware Version, Thermal and Power statistics.

Is there an API string that will pull this information?

I have tried a few random things like

http://netonix/api/v1/status
http://netonix/api/v1/system
http://netonix/api/v1/info

Re: API string for status

Posted: Tue Jun 06, 2017 10:56 am
by sirhc
Why not use our Manager Software?

viewtopic.php?f=6&t=1549

Re: API string for status

Posted: Tue Jun 06, 2017 11:34 am
by NetonixUser
Thanks but we have a large PHP platform which we developed that manages hundreds of different devices and brands and this information we want to add to our existing system.

Re: API string for status

Posted: Tue Jun 06, 2017 11:51 am
by sirhc
Well you do realize the CPU has nothing to do with switch capacity or load?

The CPU runs the UI/CLI to configure the core as well as Stats/SNMP/Daemons and such.

The memory you see also has nothing to do with buffers but rather once again the memory used by the MIPs 24K to run the UI/CLI and such.

The packet forwarding is handled in the switch core which can deliver line speed on all ports at the same time.

Eric will have to answer you on the API call but I think if you do a search on the forums this has been discussed before?

Here are a few posts that came up in a basic search:
viewtopic.php?f=17&t=2364&p=16666&hilit=API#p16666
viewtopic.php?f=6&t=1549&p=16045&hilit=API#p16045
viewtopic.php?f=6&t=1549&p=16022&hilit=API#p16022
viewtopic.php?f=6&t=2216&p=15787&hilit=API#p15787

Re: API string for status

Posted: Tue Jun 06, 2017 12:34 pm
by Eric Stern
Since you are using PHP this post will show the basics: viewtopic.php?f=6&t=2216&p=15787&hilit=API#p15787

Once you have the session cookie you will need to call /api/v1/bootid, which will return something like this:

Code: Select all
{
 "result": "Ok",
 "BootID": "JfljqEx1Vu1l57DbITFhfJtqT2wzB98W",
 "Verified": false
}


Then, using the bootid you got above you can call /api/v1/status/30sec?<bootid>, which will return a ton of information that should include everything you are looking for.

You only need to get the bootid once, it will remain valid until the switch is rebooted. If you call /api/v1/status/30sec with an invalid bootid you will only get "Uptime: 0" as a response.

Re: API string for status

Posted: Thu Jun 08, 2017 10:03 am
by NetonixUser
You are a genious thank you, it's working perfectly