Introduction

Tasks scheduler is a Microsoft Windows component that allows you to schedule programs or scripts to start at pre-defined intervals. There are two major versions of the task scheduler: In version 1.0, definitions and schedules are stored in binary .job files. Every task corresponds to a single action. This plugin will not work on version 1.0 of the task scheduler, which is running on Windows Server 2000 and 2003. In version 2.0, the Windows task scheduler got a redesigned user interface based on Management console. Version 2.0 also supports calendar and event-based triggers, such as starting a task when a particular event is logged to the event log, or when a combination of events has occurred. Also, several tasks that are triggered by the same event can be configured to run either simultaneously or in a pre-determined chained sequence of a series of actions.

Tasks can also be configured to run based on system status such as being idle for a pre-configured amount of time, on startup, logoff, or only during or for a specified time. Other new features are a credential manager to store passwords so they cannot be retrieved easily. Also, scheduled tasks are executed in their own session, instead of the same session as system services or the current user. You can find a list of all task scheduler 2.0 interfaces here.

Requirements

Starting from Windows Powershell 4.0, you can use a whole range of Powershell cmdlets to manage your scheduled tasks with Powershell. This plugin for Nagios does not use these cmdlets, as it has to be Powershell 2.0 compatible. Maybe in a few years, when Powershell 2.0 becomes obsolete, I’ll patch the script to make use of the new cmdlets. You can find the complete list of cmdlets here. Failing tasks will always end with some sort of error code. You can find the complete list of error codes here. This plugin will output the exitcodes for failing tasks in the Nagios service description. Output will also notify you on tasks that are still running. We have multiple Windows servers at work with a growing amount of scheduled tasks and each scheduled task needs to be monitored. With the help of Nagios and this plugin you can find out:

  • How many are running at the same time?
  • How many are failing?
  • How long are they running?
  • Who created them?

Versions

Disabled scheduled tasks are excluded by default from 3.14.12.06. In earlier versions, you had to manually exclude them by excluding them with -EF or -ET. It seemed like a logical decision to exclude disabled tasks by default and was suggested by someone on the Nagios Exchange reviewing the plugin.. Maybe one day I’ll make a switch to include them again if specified. As some scheduled tasks do not need to be monitored, the script enables you to exclude complete folders.

Since v5.13.160614 it is possible to include hidden tasks. Just add the ‘–Hidden 1’ switch to your parameters and your hidden tasks will be monitored.

One of the folders I tend to exclude almost all the time is the “Microsoft” folder. It seems like several tasks in the Microsoft folder tend to fail sometimes. So unless you absolutely need to know the state of every single scheduled task running on your Windows Server, I can advise you to exclude it too. You can find the folder and tasks in this locations: C:\Windows\System32\Tasks
It is possible to include tasks or task folders with the ‘–InclFolders’ and ‘–InclTasks’ parameters. This filter will get applied after the exclude parameter. Please note that including a folder is not recursive. Only tasks in the root of the folder will be included.

Help

This is the help of the plugin, which lists all valid parameters:

You could put every scheduled task  you don’t want to monitor in a separate  folder and exclude it with the -EF parameter. Alternatvely, you can use the -ET parameter to exclude based on name patterns. One quite important thing to know is that in order to exclude or include the root folder, you need to escape the backslash, like this: “\\”.

How to monitor your scheduled tasks?

  1. Put the script in the NSClient++ scripts folder, preferably in a subfolder Powershell.
  2. In the nsclient.ini configuration file, define the script like this:

    For more information about external scripts configuration, please review the NSClient documentation. You can also consider defining a wrapped script in nsclient.ini to simplify configuration.
  3. Make a command in Nagios like this:
  4. Configure your service in Nagios. Make use of the above created command. Configure something similar like this as $ARG1$:

Some things to consider to make it work:

  • “set-exectionpolicy remotesigned”
  • Nscp service account permissions => Running with local system should suffice, but I had users telling me it only worked with a local admin. I found out that on some NSClient++ versions, more specific version 0.4.3.88 and probably some earlier versions too, the following error occured when running nscp service as local system: “CHECK_NRPE: Invalid packet type received from server”. After filing an issue on the GitHub project page of NSClient++, Michael Medin quickly acknowledged the issue and solved it from version 0.4.3.102, so the plugin should work again as local system.

Examples

If you would run the script in cli from you Nagios plugin folder, this would be the command:

If you would want to exclude one noisy unimportant scheduled task, the command used in cli would look like this:

If you only want the scheduled tasks in the root to be monitored, you can use this command:

This would only give you the scheduled tasks available in the root folder. The output look like this now.

Final Words

It seems the perfdata in the Highcharts graphs sometimes contains decimal numbers (see screenshot), which is kind of strange as I’m sure I only pass rounded numbers. Seems this is related to the way RRD files are working. To reduce the amount of storage space used, NPCD and RRD while average out the data, resulting in decimals, even when you don’t expect them.

This is a small to do list:

  • Add switches to change returned values and output.
  • Add array parameter with exit codes that should be excluded.
  • Test remote execution. In some cases it might be useful to be able to check remotely for failed windows tasks.
  • Include a warning / critical threshold when discovered tasks exceed a certain duration.
  • I was hoping to add some more exit codes to check, which would make failed tasks easier to troubleshoot. You can find the list of scheduled task exit codes here. The constants that begin with SCHED_S_ are success constants, and the constants that begin with SCHED_E_ are error constants.

Screenshots:

These are some screenshots of the Nagios XI Graph Explorer for two of our servers making use of the plugin to monitor scheduled tasks: Tasks 01 check_ms_win_tasks_graph_02 Let me know on the Nagios Exchange what you think of my plugin by rating it or submitting a review. Please also consider starring the project on GitHub.

Willem

Willem D'Haese
Expert Monitoring at Digipolis
Expert Monitoring with a demonstrated history of working in the information technology and services industry. Strong ICT skills such as monitoring, virtualization, automation.

75 Comments

  1. Thanks!!! really great and usefull plugin!!
    by the way. do you have any example of syntax with -ET argument?
    Thanks!

    1. Example: ‘-H localhost -EF Microsoft, Backup_Maintenance -ET Jeff, Fimacs’

      This should exclude all tasks with Jeff or Fimacs in the name..
      Let me know if you get it working… 🙂

  2. hi, sorry to be bothering you again, we are getting this error running the script as is on the nsclient.ini:

    C:Users!afasano.PBN>cmd /C echo “c:Program FilesNSClient++scriptscheck_ms_win_tasks.ps1” $ARG1$; exit $LastExitCode | powershell.exe -command –
    Símbolo (token) inesperado ‘ARG1’ en la expresión o la instrucción.
    En línea: 1 Carácter: 67
    + “c:Program FilesNSClient++scriptscheck_ms_win_tasks.ps1” $ARG1 <<<cscript.exe //T:30 //NoLogo “C:program FilesNsClient++scriptscheck_ad.vbs”
    OK – services: OK. replications: OK. advertising: OK. fsmocheck: OK. ridmanager:OK. machineaccount: OK.

    can you help me out with this¿?
    Thanks!!

    1. Hey,

      Do you have powershell execution policy set to remotesigned as described in this post?

      Grtz

        1. Ok, next question. Is the server on which you are running the plugin English? Because it will not work on non-English Windows servers.. And what Windows version are you running it on?
          Are you using Nagios? XI? What version? Do you have any other Powershell scripts working with NSClient? You have to specify at least one argument in your command. Can you send me the command you are using? Did you specify anything in $ARG1$?

          1. Hi, when I test it, I get the following message:

            # ./check_nrpe -H x.x.x.x -p 5667 -c check_ms_win_tasks -a ‘-H localhost -IF Microsoft’
            CRITICAL: Seems like something is wrong with your parameters: Args: $.

            The operating system is non-English (Windows 2008 R2 Standard Spanish) there is anything I could do?

            Thank you in advance,

  3. hey willem, sorry to be bothering you again, but i still cant make the script work from nagios, i mean, if i run the script from powershell it runs ok, but when i put the line you said in the nsclient.ini
    . check_ms_win_tasks=cmd /c echo scriptscheck_ms_win_tasks.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command –
    . define the command
    . define the service

    doesnt seem to be working, i get:
    (No output returned from plugin)

    if i run ./check_nrpe -H x.x.x.x -p 5666 check_ms_win_tasks from nagios server it shows:

    I (0,4,1,90 2013-02-04) seem to be doing fine…

    its ok?

    Thanks for the help!
    Regards.

    1. Hey Alexis,

      One thing I notice is that you do not have any arguments defined after “./check_nrpe -H x.x.x.x -p 5666 check_ms_win_tasks”. As in NSClient we specified $ARG1$, you have to specify at least one argument, so please try something like this: “./check_nrpe -H x.x.x.x -p 5666 check_ms_win_tasks -a ‘-H localhost -EF Microsoft’”
      I think you must use the single quotes around the arguments after -a.

      Let me know how it goes. It should work…

      Grtz

      Willem

  4. Sorry, but do we have to replace the $ARG1$ by something in the sentence we add in nsclient.ini ?

  5. Please forget my previous question, I resolve it by myself, I have an error “Arguments not allowed” when I write the ‘-H localhost -EF Microsoft, Backup_Maintenance’ in the -a option, what can be the cause of this ?

    1. Hey Churo,

      Sorry for answering your question so late. My guess is that you did not configure your nsclient.ini to allow arguments with nrpe. Please check your nsclient.ini.

      [/settings/NRPE/server]
      allow arguments=true

      [/settings/external scripts/server]
      allow arguments=true

      You can find more info here: http://nsclient.org/nscp/wiki/guides/nagios/external_scripts

      I hope this helps.

      Grtz

      Willem

  6. Great job!
    I´m quite new to Nagios and really don´t know what do you mean with “Make a command in Nagios”.

    Should I define a new command in my windows cfg file?

    Thanks for your help!

  7. Thanks for sharing. I have tried to run the plugin but I do have some problems.

    _USER1_/check_nrpe -s -H 10.8.10.10 -p 5666 -t 60 -c check_ms_win_tasks -a “-H localhost -EF ADUserCheck -ET Microsoft”
    Result code: CRITICAL
    23 / 51 tasks failed! Check tasks: -> Task Optimize Start Menu Cache

    I use the arguments:
    “-H localhost -EF ADUserCheck -ET Microsoft”
    In OP5 (Nagios)

    Have I missed someting? I have my scheduled task placed in my root folder om my w2012 server.

  8. Planetfour,

    You are using -ET which is for excluding a task. Try -EF Microsoft to exclude the Microsoft folder..

    Grtz

    Willem

  9. Thanks, Maybe I did not read the documentation good enough as usual. Now I ran:

    ./check_nrpe -s -H 10.8.10.10 -p 5666 -t 60 -c check_ms_win_tasks -a “-H localhost -EF Microsoft -ET Opt*, Ip*”

    and got:

    1 / 1 tasks ran succesfully!| ‘Total Tasks’=1, ‘OK Tasks’=1, ‘Failed Tasks’=0, ‘Running Tasks’=0

    So I guess it works fine now. Thanks!

  10. I configured everything according toy your instructions. but I am getting empty oitput when I run it from Nagios Xi (one we trial)

    When I run ps script on the host, it produce output, but from nagios server just blank.

    I install the latest client (it is using NSC.ini) and enable all modules when I ran setup.

    I am new to nagios, so I am not sure if my ini file is setup correctly.

    allow_arguments=1 is set in both places.

  11. Steven,

    Your settings file should be called nsclient.ini. Are you using 0.4.1.105? Are you able to run any Powershell script from Nagios? Please carefully read the ‘How to use’ part and it should work. If you don’t get it to work, please post a thread at Nagios Support forum (https://support.nagios.com/forum/viewforum.php?f=6), as I have the feeling your issuue is not related to my plugin. Let me know how it goes.

    Grtz

    Willem

  12. Hi,

    Can you please suggest me on below. I have two tasks that I need to monitor on the server
    root@nagios01:/usr/local/nagios/etc/objects# /usr/local/nagios/libexec/check_nrpe -H 10.10.161.27 -p 5666 -c check_ms_win_tasks -a ‘-H localhost -EF Time_Sync_2’
    Missing expression after unary operator ‘-‘.
    At line:1 char:2
    + – <<<<
    + CategoryInfo : ParserError: (-:String) [], ParentContainsErrorR
    ecordException
    + FullyQualifiedErrorId : MissingExpressionAfterOperator
    root@nagios01:/usr/local/nagios/etc/objects#

    1. Hmm what happens if you use it on the Windows Server with the same parameters ‘-H localhost -EF Time_Sync_2’. Did you succesfully use other Powershell scripts with Nagios?

  13. I am getting

    COMMAND: /usr/local/nagios/libexec/check_nrpe -H xxx.xxx.xxx.xxx -p 5666 -t 60 -c check_ms_win_tasks -a -H localhost
    OUTPUT: The string starting:
    At line:1 char:3

    is missing the terminator: “.
    At line:1 char:4

    + CategoryInfo : ParserError: (:String) [], ParentContainsErrorRe
    cordException
    + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

    1. I guess I missed some argument formatting.

      [root@localhost /]# /usr/local/nagios/libexec/check_nrpe -H my.server.ip -p 5666 -c check_ms_win_tasks -a ‘-H localhost -IF “\\”‘
      The string starting:
      At line:1 char:3
      + ? <<<< "
      is missing the terminator: ".
      At line:1 char:4
      + ?" <<<<
      + CategoryInfo : ParserError: (:String) [], ParentContainsErrorRe
      cordException
      + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

    2. I duplicate command on the windows server in nsclient.ini not to use any arguments but I am getting exactly the same error.

      /usr/local/nagios/libexec/check_nrpe -H 10.8.8.97 -p 5666 -c check_ms_win_tasks1 <– this is modified comand

      At line:1 char:3

      is missing the terminator: “.
      At line:1 char:4

      + CategoryInfo : ParserError: (:String) [], ParentContainsErrorRe
      cordException
      + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

  14. Dear Willem

    If I try to run the plugin in the CLI on my Nagios server I get the error:
    Unknown command(s): cmd

    My script from the Nagios plugin folder
    ./check_nrpe -H TEST-SERVER -p 5666 -c check_ms_win_tasks -a “-H localhost -EF Microsoft”

    nsclient.ini
    check_ms_win_tasks=cmd /c echo scripts/powershell/check_ms_win_tasks.ps1 $ARG1$; exit $LastExitCode | powershell.exe -command –

    My apologies, I’m not a wizard in Nagios and Powershell.

    Kind regards
    Matt

  15. Hello,

    I would like to monitor *ONLY* the Microsoft tasks and tried this command:
    check_ms_win_tasks.ps1 -IF Microsoft

    … but it only returns: “0 / 0 tasks ran succesfully. | ‘Total Tasks’=0, ‘OK Tasks’=0, ‘Failed Tasks’=0, ‘Running Tasks’=0”

    What am I doing wrong?

    1. Hey Timo,

      At the moment the plugin -IF parameter will only include the tasks directly in the passed folder, not those in the subfolders of the passed subfolder. I’m guessing the Microsoft folder has no tasks in it. You could try to monitor all tasks and use -EF to exclude all other folders in your task scheduler? or You can explicitly specify the folders in the Microsoft folder you need. If you would like me to extend the plugin with some sort of way to make the -IF recursively, please start with making an issue on GitHub and I’ll have a look at it when I find some time. Let me know if you mange to get it working. 🙂
      Grtz.
      Willem

  16. My system is Windows 2003 R2, PowerShell V2.0, tip in running the script with no parameters
    Error: Schedule.Service COM Object not found on localhost, which is required by this script.

  17. Thank you for the script. It’s working while I’m executing it via shell. But if I implement it on Nagios (Centreon frontend) I get an check failure: “UNKNOWN: Return buffer to small to handle this command.”

    What can I do?

    1. Leopard, I have zero experience with Centreon and never saw this error before. Are you using NSClient to execute the script? It might be better to discuss this issue with the Centreon community?

  18. How can I exclude folders with a space?

    define service{
    use generic-service
    check_command check_ms_win_tasks!”-EF Microsoft, AVAST Software”
    service_description Windows Task Scheduler
    host_name WEB01
    }

  19. Hello,

    do i something wrong in the service definition :

    check_command check_nrpe!check_ms_win_tasks!-a ‘-H localhost -IT tisoware.PERYSIN’

    i get :
    Error: Illegal arguments detected: $

  20. Hi!

    I am having the following issue, I have several tasks that are configured as ‘hidden’ and I can’t monitor them. Any workaround suggested?

  21. Hi !
    Having an authorization problem :
    Running the ps as admin works perfectly.
    Running as nagios or another user shows “access denied”.
    Is there a workaround ?
    Running PS 4.0 fr-FR

    Thx for your help !

    nt

    1. What version of NSClient are you using? Please upgrade to latest (0.5.0.46 atm). NSClient runs the splugin as SYSTEM which should work..

  22. Hi,

    Dosen’t work for me :
    PS C:\Program Files\NSClient++\scripts> .\check_ms_win_tasks.ps1 -H localhost -IF “\\”
    CRITICAL: Argument: -H Value: localhost Error: Exception setting “GuestName”: “The property ‘GuestName’ cannot be found on this object. Verif
    y that the property exists and can be set.”

    Test with nsclient 0.4.4.19 and 0.5.0.46.

  23. Hello Willem

    I execute _USER1_/check_nrpe -s -H 10.0.01 -p 5666 -t 60 -c check_ms_win_tasks -a ‘-H localhost -ET Opt* ‘

    and I got the following Error :
    _USER1_/check_nrpe -s -H hostname -p 5666 -t 60 -c check_ms_win_tasks -a ‘-H localhost -ET Opt* ‘
    and I got the following error

    Result code: 2
    ERROR OUTPUT:
    execvp(_USER1_/check_nrpe, …) failed. errno is 2: No such file or directory
    ====================
    STANDARD OUTPUT:

    is there is any solution ?

    1. Please try to run the script locally on the Windows Server. This seems like a Nagios issue to me. If it works in Powershell, try calling it from cli on your Nagios server. Grtz. Willem

      1. I fix it on Op5 (Nagios) and I get the following error:
        result code: CRITICAL
        CRITICAL: Argument: -H Value: localhost Error: Exception setting “GuestName”: “The property ‘GuestName’ cannot be found on this object. Verify that the property exists and can be set.”
        would you please suggest what could it be the problem ?

  24. Hello Willem,

    Really an useful article to capture the Scheduler tasks. I am fairly new to this plugin and have a query against it. I am not able to figure out the parameters that need to be sent in this scenario below.

    So i have a Windows 12 server where i need to monitor the logs present under Task Scheduler- Operational logs( present under Event Viewer—> Application and Services logs–>Microsoft–>Windows–>Task Scheduler–>Operational Logs.

    My parameters that can help finding the log are the below

    Level: Error
    Source: Task Scheduler
    Event ID: 101
    Task Category: Task Start Failed
    Task Name: \ProjectName.Customer.ActiveDirectory.EmployeeAccountsRead

    How do we convert the above into arguments so that it can search for the logs within the Application and Services logs–>Microsoft–>Windows–>Task Scheduler–>Operational Logs.

    I tried to pass but it gives me all the high level tasks from the root. Please help

    1. You are looking at the plugin the wrong way. It doesn’t parse the logfiles. It loops through the tasks with Powershell $schedule = New-Object -com('Schedule.Service')

      Please read carefully through the docs. There are enough examples imho?

      Grtz

      1. Hi Willem,

        Thanks for your reply. I understand that it doesn’t parse the logs but i would like to monitor the logs present under

        Task Scheduler- Operational logs( present under Event Viewer—> Application and Services logs–>Microsoft–>Windows–>Task Scheduler–>Operational Logs.

        I need to know how to map the parameters to the below. For eg if i see a task has failed due to some reason as this

        Level: Error
        Source: Task Scheduler
        Event ID: 101
        Task Category: Task Start Failed
        Task Name: \ProjectName.Customer.ActiveDirectory.EmployeeAccountsRead

        So now

        how do i map the above to the parameters below for your script.

        Sorry, but i have tried several ways and not able to get anywhere.

        check_ms_win_tasks.ps1: This script is designed to check Windows 2008 or higher scheduled tasks and alert in case tasks
        failed in Nagios style output.
        Arguments:
        -H | –Hostname => Optional hostname of remote system, default is localhost, not yet tested on remote host.
        -EF | –ExclFolders => Name of folders to exclude from monitoring.
        -IF | –InclFolders => Name of folders to include in monitoring.
        -ET | –ExclTasks => Name of task patterns to exclude from monitoring.
        -IT | –InclTasks => Name of task patterns to include in monitoring.
        -Hid | –Hidden => Switch to determine if hidden tasks need to be excluded.
        -h | –Help => Print this help output

        1. Something like this
          check_ms_win_tasks -IT ProjectName.Customer.ActiveDirectory.EmployeeAccountsRead
          Supposing your task is called ‘ProjectName.Customer.ActiveDirectory.EmployeeAccountsRead’
          For example for a task on my pc, which is called ‘UpdateLibrary’
          check_ms_win_tasks.ps1' -IT UpdateLibrary
          1 / 1 tasks failed! {Taskname: "UpdateLibrary" (Author: $(@%ProgramFiles%\Windows Media Player\wmpnscfg.exe,-1001))(Exitcode: 267011)(Last runtime: 11/30/1999 00:00:00)} | 'Total Tasks'=1, 'OK Tasks'=0, 'Failed
          Tasks'=1, 'Running Tasks'=0

  25. Hello,

    First of all, thank you for this wonderful script ! It helps a lot.
    I have successfully installed the script on Windows 2008 R2 when powershell v1.0 is already installed by default.

    However, I have this error on Windows 2008 :

    Unable to find type [Parameter(Mandatory=$True)]: make sure that the assembly containing this type is loaded.
    At C:\Program Files (x86)\NSClient++\scripts\check_ms_win_tasks.ps1:131 char:37
    + [Parameter(Mandatory=$True)]$ <<<< Args

    Do you know how to solve this ?

    Thank you very much

      1. Hello,

        The powershell version is 1.0

        The full command is : check_nrpe -H $HOSTADDRESS$ -c check_ms_win_tasks -a ‘-EF Microsoft -ET “Optimize Start Menu Cache Files”‘ -t 30

        In the file nsc.ini on the servers :
        check_ms_win_tasks=cmd /c echo scripts/check_ms_win_tasks.ps1 $ARG1$; exit $LastExitCode | powershell.exe /noprofile -command –

        Thank you !

  26. Hi Willem,

    Thanks you very much for this, it’s really usefull for me and it’s helping me a lot.

    In the other hand, I have a question, I’m having some false positives in tasks that never has started, showing that info, for example:

    ” {Taskname: “Copia Abril” (Author: DOMAIN\USER)(Exitcode: 1)(Last runtime: 12/30/1899 00:00:00)} {Taskname: “Copia Agost 17″ (Author: DOMAIN\USER)(Exitcode: 1)(Last runtime: 12/30/1899 00:00:00)}” ”

    There are some option for ignore scheduled tasks that has never started?

    Thank’s you a lot!

    1. Glad you like it. At this time the script will fail if the exitcode is not 1. Please make an issue on GitHub and I might add such an option later. Grtz!

  27. Hello Willem ,
    Thank you for the neat script , I have a question about how to ignore Exitcode 1 as a task fail ?
    Thank you

  28. I have the same question as Nael, how can we ignore ExitCode 1 as a task fail?
    With the ExitCode 1, sometimes Nagios send a Critical and sometimes OK.

  29. Thanks for this great plugin, it can be used ( maybe in the future ) also to “force start” one scheduled task? or it’s just intended to monitor the scheduled task also for the feature version?
    Thanks!

  30. Hi,

    I followed the instructions here and placed this on my nsclient.ini file:

    [/settings/external script/scripts]
    check_ms_win_tasks=cmd /c echo scripts/powershell/check_ms_win_tasks.ps1 $ARG1$; exit $LastExitCode | powershell.exe /noprofile -command –

    But when I check from my nagios server using this:

    ./check_nrpe -H 10.20.34.218 -p 5666 -c check_ms_win_tasks -a ‘-H localhost -EF Microsoft’

    I get this error:
    Unknown command(s): check_ms_win_tasks

    I’ve already restarted the service as well after I added the line in nsclient.ini.

    Also when I run the script directly on the windows server box, it gives me this:
    .\check_ms_win_tasks.ps1 : File C:\Program Files\NSClient++\scripts\check_ms_win_tasks.ps1 cannot be loaded. The file
    C:\Program Files\NSClient++\scripts\check_ms_win_tasks.ps1 is not digitally signed. You cannot run this script on the
    current system. For more information about running scripts and setting execution policy, see about_Execution_Policies
    at http://go.microsoft.com/fwlink/?LinkID=135170.
    At line:1 char:1
    + .\check_ms_win_tasks.ps1
    + ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

    Are the error related? Any ideas?

    Cheers,
    Kai

  31. Works just fine in NCPA as well. Drop it in your Plugins folder and call it -a “”

  32. Hi Willem,

    Great plugin to monitor task scheduler status.

    We have setup this plugin to monitor Task scheduler in Windows 2008 server and it is working as expected.

    Can you let us know if it is possible to start the Task Scheduler whenever it finds it is Not running .

    1. Vani,

      It should be possible to add an option to do that. But atm I have very little time. I suggest you make a GitHub issue to start with.

      Grtz

  33. Thanks for your response.

    I am able to restart task using Event handler with batch script in Nagios.

  34. Hi Willem,

    I have recently observed one issue that task is exiting with Error code 2147216609 (instance of this task already running).

    Can you let us know if it is possible to exit the task with particular error code ?

    Thank You.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

eighteen + 5 =