JobMonitors

Can LogicMonitor monitor custom data for my job?

Yes, you can have your monitored batch jobs report other custom data to LogicMonitor, for informational purposes.  This data will be displayed in LogicMonitor, but it won't be used for alerting or graphing purposes.  The custom data reported to LogicMonitor can be any desired information, for example it could be static content such as "reportSentTo: myboss", or information output by the batch job run on your system.

To enable custom data collection, you'll need to modify the batch job wrapper (either lmbatchjobwrapper.js for windows or lmbatchjobwrapper.pl for linux) to report userData in the #start the customer job section of the script.  Specifically, there are three edits necessary:

  1. add a line 'my $userData = "You custom data goes here";' after the 'my $level....' line
  2. add a comma after 'alertLevel => $level'
  3. add a new line after the line edited in 2 'userData => $userData

The end result should look like this:

my $level = $exitCode eq 0 ? 'ok' : 'error';
my $userData = "fileDeleted: 55, reportSentTo: myboss";

$response = $ua->post( $url, [
    type => 'finish',
    executionNo => $executionNo,
    hostName => $hostname,
    batchjobName => $jobname,
    epoch => time(),
    stdout => $stdout,
    stderr => $stderr,
    exitCode => $exitCode,
    alertLevel => $level,
    userData => $userData 
]);