JobMonitor Job Name matters
I'm putting there here for all the literal people like me who follow the directions exactly. In the documentation for using JobMonitor, when it provides examples of how to use the wrapper script, it glosses over the "job name" parameter. Even in the example they just call it "myJob" as though it weren't important.
The job name you pass to the wrapper has to MATCH the name of the JobMonitor you created or it won't show up. Here are my instructions:
Create a JobMonitor
Click Settings->LogicModules
Click the + button and add a JobMonitor
Name the JobMonitor
If you don't like using quote marks later, name it without spaces
ex. "WSUSReportTask"
Assign an AppliesTo
Ex. "isWindows()" if your task is the same on every server
system.displayname == "THEBOM-WSUS3" if your task only runs on a server named "THEBOM-WSUS3
Click Save
Click Commit Version
Download the wrapper from your collector
Its located in the lib folder of the collector agent folder.
Ex. On collectors hosted on a windows server its
C:\Program Files (x86)\LogicMonitor\Agent\lib\lmbatchjobwrapper.js
the file expects to be run from cscript, so if you are using node.js, well you are smarter than me
Create the scheduled Task on your server
The name of the tasks doesn't matter
The Program and parameters matter
Program: cscript.exe or the full path to the cscript.exe file
parameters : <path to wrapper>\lmbatchwrapper.js <collectorIP>:7214 <WinHostResourceName> <JobMonitorModuleName> <cmd+params>
ex. here are the params I used to execute my job
lmbatchjobwrapper.js thebom-monitor:7214 THEBOM-WSUS3 "WSUSReportTask" "cmd.exe /c c:\scripts\getHostname.bat"
Assuming that networking works and you have refreshed your discovery on the resource in Logicmonitor, you should now have the JobMonitor resource and these jobs results will show up.