Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Get email notification if cron task fails? (PMWoGen)

  • 1.  Get email notification if cron task fails? (PMWoGen)

    Posted Fri May 21, 2021 07:57 PM
    Edited by System Admin Wed March 22, 2023 11:53 AM
    MAM 7.6.1.2:

    I want to monitor for an issue where PMWoGenCronTask gets interrupted:

    More info in #5 here: Logic behind scheduled PMs?

    Question:

    Is there a way to get an email notification if a cron task fails?

    #Maximo
    #AssetandFacilitiesManagement


  • 2.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Mon May 24, 2021 08:49 AM
    Try setting up CRONMONITOR: https://www.imwuc.org/HigherLogic/System/DownloadDocumentFile.ashx?DocumentFileKey=9047088b-c8bf-462b-ab83-c620334999bf

    ------------------------------
    Steve Hauptman
    ------------------------------



  • 3.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Mon May 24, 2021 09:09 AM
    We try to avoid monitoring Maximo inside Maximo. The processes we define as critical we setup an external monitoring check that makes a REST API call into to Maximo to get the necessary metadata to determine if it's missed executions, if it's running longer than it should, etc. For example, if our email listener takes longer than 5 minutes on an execution it's probably stuck forever and that JVM needs to be restarted.

    If we have a problem that prevents cron tasks from running, anything we setup in the Maximo system that could capture it utilizes the same cron task framework and might not run. Scheduled reports, escalations, automation script cron tasks, async jobs, etc. all utilize cron tasks. And we find people are more likely to turn something off inside the Maximo system and forget to turn it back on which wouldn't be good if the thing they forgot to turn back on is the thing monitoring your processes.

    ------------------------------
    Steven Shull
    Director of Development
    Projetech Inc
    ------------------------------



  • 4.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Tue May 25, 2021 03:56 AM
    Its a bit old school the approach I took, but works okay...
    Firstly, if you have set up the PMWOGenCron to send you the report when it runs, then if you don't have this report, then the chances are (if you have a lot of data) that it may not have run.  A quick check of the last run date will confirm if it has...
    Secondly I set up an escalation that runs in the early hours of the morning that looks to see if there are ​PMs that should have fired the previous evening but have failed to do so - this will email me if there are any - a word of warning though, this may send a lot of emails if there are a lot of failures.. but as an escalation you can send this to as many users as you like - the Cron can only deal with a single email address so needs to be an email group which can be harder to administer.

    This was put in place originally as the Cron was running, but the SQL behind it was flawed, so it was only when we looked at what should have fired we could see that the Cron was missing some out.

    As I say it is a bit primitive but has proven to be pretty robust.  And it is easy to set up and disable if required.

    ------------------------------
    Brian Williams
    Maximo System Administrator
    Ineos FPS
    ------------------------------



  • 5.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Tue May 25, 2021 10:26 AM
    And if you don't want lots of emails, you write your escalation against DUMMY_TABLE with a subquery against PM. Then you get one email regardless of how many PMs fail. I have done this kind of approach lots.

    ------------------------------
    Blessings,
    Jason Uppenborn
    Sr. Technical Maximo Consultant
    Ontracks Consulting
    ------------------------------



  • 6.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Thu June 17, 2021 12:31 PM
    Ooh, show that query please!

    ------------------------------
    Christopher Wanko
    ------------------------------



  • 7.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Thu June 17, 2021 10:28 PM
    Edited by System Admin Wed March 22, 2023 11:50 AM
    Hi Jason,

    Similar to the method you mentioned:

    Do you know if there would be a reason why WHERE ROWNUM = 1 (or SQL Server equivalent) wouldn't work?

    I did some limited testing, and it seemed to work ok (only sent 1 email). But I'm pretty green when it comes to escalations, so there might be a reason not to do that.

    Repeat = Yes

    Thanks.
    #Maximo
    #AssetandFacilitiesManagement


  • 8.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Thu June 17, 2021 12:47 PM
    @Brian Williams

    Would you mind clarifying:

    What report are you referring to in this blurb?
    "...​if you have set up the PMWOGenCron to send you the report when it runs..."

    Thanks. PMs are new to me.


  • 9.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Thu June 17, 2021 02:00 PM
    I'm not Brian, but:  in the Organization setup, PM options, there's a spot where you can specify an e-mail address (or multiples).  That results in a report being sent, which details each PM record that was considered, and whether a work order was created, and if not, then why not.  If a work order creation failed, the error will also be in that file.

    I typically set myself up to receive the e-mails, and have an Outlook rule to stash them in a sub-folder UNLESS it has the word "failed" in it, in which case it stays in my Inbox so I can deal with it.

    Hope this helps.

    ------------------------------
    Shannon Rotz
    InComm Solutions
    New Westminster BC
    ------------------------------



  • 10.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Thu June 17, 2021 02:03 PM
    ​The PM generation Cron runs as required by the settings in the Cron task setup, but if you want the Cron to only look at a subset of the data - e.g. PMs that are ACTIVE, and have a next due date within a certain window, and want to be emailed the results, these values are set in the Organisations application under PM Options - see below
    You


    the "report" is similar to that when a user manually fires PMs, and shows successful creation and also failures;

    Note that the format of this email is not always the easiest to follow - failures first followed by successful generations would in my view be more useful.

    IBM did I believe put this out for review with their key technical users some time ago, but I never heard if there was a conclusion to that, although it was mentioned that a Birt report was suggested as being a solution.

    Are any of our expert colleagues able to shed light on where this got to?

    ------------------------------
    Brian Williams
    Maximo System Administrator
    Ineos FPS
    ------------------------------



  • 11.  RE: Get email notification if cron task fails? (PMWoGen)

    Posted Thu June 17, 2021 02:17 PM
    ​I forgot to mention that the email field can only hold one value, certainly in 7.6.0.8
    This is frustrating when you want to send this to multiple users, and the only option is to create an email group.

    ------------------------------
    Brian Williams
    Maximo System Administrator
    Ineos FPS
    ------------------------------