Skip to content

Commit

Permalink
Merge pull request #911 from mountaindude/908
Browse files Browse the repository at this point in the history
Debug winsvc monitoring
  • Loading branch information
mountaindude authored Dec 12, 2023
2 parents c243715 + f7c730c commit 5378a48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib/service_monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ const checkServiceStatus = async (config, logger, isFirstCheck = false) => {
servicesToCheck.forEach(async (service) => {
logger.verbose(`Checking status of Windows service ${service.name} (="${service.friendlyName}") on host ${host.host}`);

const serviceStatus = await svcTools.status(logger, service.name);
const serviceStatus = await svcTools.status(logger, service.name, host.host);
logger.verbose(`Got reply: Service ${service.name} (="${service.friendlyName}") on host ${host.host} status: ${serviceStatus}`);

// Get details about this service
const serviceDetails = await svcTools.details(logger, service.name);
const serviceDetails = await svcTools.details(logger, service.name, host.host);
if (
serviceStatus === 'STOPPED' &&
config.has('Butler.incidentTool.newRelic.serviceMonitor.monitorServiceState.stopped.enable') &&
Expand Down Expand Up @@ -558,10 +558,11 @@ async function setupServiceMonitorTimer(config, logger) {
}
const sched = later.parse.text(config.get('Butler.serviceMonitor.frequency'));
later.setInterval(() => {
checkServiceStatus(config, logger);
checkServiceStatus(config, logger, false);
}, sched);

// Do an initial service status check
logger.verbose('Doing initial service status check');
checkServiceStatus(config, logger, true);
}
} else {
Expand Down

0 comments on commit 5378a48

Please sign in to comment.