banshee is under active development: collectors will keep changing, and a version you publish will likely need adjustments. For stable use, wait for version 1.0.0.

Windows

banshee/windows-collection/windows/snmp/

services

The started services of a Windows and their state, by SNMP

  • windows
  • snmp
  • services

by banshee1 installation2 versions

Keen 1.0.0 · 27 lines
// The services of a Windows, by SNMP, from svSvcTable (LanMgr-Mib-II, 1.3.6.1.4.1.77).
// Windows lists only the started services there: a stopped service disappears from the table, and it
// is the watch "Service stopped" that sees it, on the names it is given. The name of a service
// is its display name, in the language of the system ("Windows Event Log", "Journal d'événements
// Windows").
need('protocol:snmp');

per('service', 'Services', array('only' => array('Windows Event Log')));
output('state', 'text', array('label' => 'State', 'per' => 'service'));

// No name expected by default: a name written here in English would raise wrongly on a system in another language.
watch.missing('stopped', 'Service stopped', 'state');
watch.expect('not-active', 'Service paused or in transition', 'state', array('warning' => array('active')));

// Indexed by the name of the service written as an OID: svSvcName and svSvcOperatingState, which is active (1),
// continue-pending (2), pause-pending (3) or paused (4).
$services = snmp.table(array(
    'name'  => '1.3.6.1.4.1.77.1.2.3.1.1',
    'state' => '1.3.6.1.4.1.77.1.2.3.1.3',
));
$states = array(1 => 'active', 2 => 'continue-pending', 3 => 'pause-pending', 4 => 'paused');

foreach ($services as $row) {
    if (list.has($row, 'name') && list.has($row, 'state')) {
        value('state', list.get($states, $row['state'], 'unknown'), $row['name']);
    }
}