I'm writing a widget to monitor specific services on several machines (30 license services across 5 machines), and I'm trying to figure out where in the SpiceWorks API the data about service states are held.
I was able to locate a single service and I was looking at the properties of the object to try to find service state, here's where I've gotten so far..
JavaScript
varservices=SPICEWORKS.data.Device.find('all',{hostname:'licenseserver1',method:'services'});vary;varz;varx=1;varout='';for(yinservices){if(isNaN(y))// If y isn't a service, I don't care to hear about it{break;}else{out=out+""+y+" ";// Setting up an HTML table for outputfor(zinservices[y])// Property list of a specific service{out=out+""+z+" "+""+services[y][z]+" ";}out=out+" ";}}element.innerHTML=out;
This topic first appeared in the Spiceworks Community