API string for status

NetonixUser
Member
 
Posts: 7
Joined: Wed Oct 19, 2016 8:51 am
Has thanked: 0 time
Been thanked: 1 time

API string for status

Tue Jun 06, 2017 10:46 am

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

User avatar
sirhc
Employee
Employee
 
Posts: 7415
Joined: Tue Apr 08, 2014 3:48 pm
Location: Lancaster, PA
Has thanked: 1608 times
Been thanked: 1325 times

Re: API string for status

Tue Jun 06, 2017 10:56 am

Why not use our Manager Software?

viewtopic.php?f=6&t=1549
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.

NetonixUser
Member
 
Posts: 7
Joined: Wed Oct 19, 2016 8:51 am
Has thanked: 0 time
Been thanked: 1 time

Re: API string for status

Tue Jun 06, 2017 11:34 am

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.

User avatar
sirhc
Employee
Employee
 
Posts: 7415
Joined: Tue Apr 08, 2014 3:48 pm
Location: Lancaster, PA
Has thanked: 1608 times
Been thanked: 1325 times

Re: API string for status

Tue Jun 06, 2017 11:51 am

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
Support is handled on the Forums not in Emails and PMs.
Before you ask a question use the Search function to see it has been answered before.
To do an Advanced Search click the magnifying glass in the Search Box.
To upload pictures click the Upload attachment link below the BLUE SUBMIT BUTTON.

User avatar
Eric Stern
Employee
Employee
 
Posts: 532
Joined: Wed Apr 09, 2014 9:41 pm
Location: Toronto, Ontario
Has thanked: 0 time
Been thanked: 130 times

Re: API string for status

Tue Jun 06, 2017 12:34 pm

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.

NetonixUser
Member
 
Posts: 7
Joined: Wed Oct 19, 2016 8:51 am
Has thanked: 0 time
Been thanked: 1 time

Re: API string for status

Thu Jun 08, 2017 10:03 am

You are a genious thank you, it's working perfectly

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 21 guests