Eric Rafaloff

My personal blog on software development and security

Home » Server Performance Monitoring as an API

Server Performance Monitoring as an API

I recently setup Cacti to gain more insight on some server performance issues we were facing at work. Previously we had been using NewRelic, but found it to be expensive and limited in the stats it gathered and presented. If you’ve never heard of Cacti, it’s a fantastic in-house solution for network graphing. The graphs are generated using RRDTool, and front-end web interface allows you to set up automated polling of servers using a number of different methods. It’s quite a bit of more work to setup than using a managed solution, but you can tailor the polling to what you’re interested in and gather more in-depth stats.

The most popular method of polling is using the Simple Network Management Protocol, or SNMP. It’s very standards-driven, which is great for network engineers because it means that any device running SNMP can report stats on the same stuff. It’s not so great for developers though, because working with it often involves consulting a type of database known as a management information base, and addressing the stats you’re interested in by OID. You have to know the exact OID you’re interested in (or use a tool like SNMP Walker to “walk” the MIB tree), and some systems differ slightly in the OIDs they implement. I can’t say that SNMP is bad. I’m not a network engineer, so I don’t think I have a place to criticize it. SNMP provides a standardized interface to talk to network devices and can even be used to configure devices remotely. It’s really powerful. However, if you’re like me and you’re interested in just gathering performance stats on some servers, it can take a lot of work to setup.

I thought it would be really cool if there were an API for server performance monitoring. Something that you could just run– securely of course– and would then tell you about the performance of whatever it was running on over HTTP. Then you could have consumers do different things like setup alerts, draw graphs, automatically scale a cluster, etc.I couldn’t find anything quite like what I had in mind, so I decided to start developing something myself. You can find the project here. I’ve named it sys.json, and at this point it’s a proof of concept more than anything. I’ve got it running on my own personal server and it has reported reliably so far. However it isn’t fully tested, nor is the codebase very mature yet, so I cannot recommend that you rely on it for anything mission critical.

Some examples of requests and responses are as follows:

Name of author

Name: ericr

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.