Ad Widget

Collapse

Monitoring Scheduled Task

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • F35335C
    Junior Member
    • Oct 2017
    • 7

    #1

    Monitoring Scheduled Task

    Hello everybody ! I'm new on Zabbix ..

    Informations Zabbix : Version Zabbix 3.2.6
    Informations Host : Windows 10, Firewall is disabled.
    Informations agent : Version 3.2.0

    I've a host running Windows monitoring by my Supervisor Zabbix. This host communicate by an agent with Zabbix.
    On this host, i've created a task scheduled. I want to monitoring this task process and found a possible error. I want found on my Zabbix Dashboard the reply of this process.

    I've found on the Web many topics on it but no response at my problem.
  • kaspars.mednis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2017
    • 349

    #2
    Hello !

    have you looked at
    https://share.zabbix.com/operating-s...hes-planifiees ?

    Best regards,
    Kaspars

    Comment

    • F35335C
      Junior Member
      • Oct 2017
      • 7

      #3
      Reply for Kaspars

      Thank for you fast response Kaspars !

      Yes of course, i've tried to do Something with this topic. I've followed the tutorial and on my Zabbix server i can't see anything of specific from configured.

      But if you have an another links, propositions or solutions, i'm ready to try it.

      Again thank of you reply.

      Best regards,

      Comment

      • kaspars.mednis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2017
        • 349

        #4
        can you explain a little bit what do you mean by

        I've followed the tutorial and on my Zabbix server i can't see anything of specific from configured.
        it was not working ? I have checked this template and it seems fine to me

        Regards,
        Kaspars

        Comment

        • F35335C
          Junior Member
          • Oct 2017
          • 7

          #5
          Reply for khaspars

          I'm sorry if you dont have understand what i meant.

          Indeed, this template is a very good tutorial if you want to configure a monitoring applicative on your Zabbix Server. But i can't understand how see the result of the script used by the agent on my Zabbix Server.

          Yes for you maybe it well but not for me. I will describe all i do.

          I've installed the Zabbix agent on my host.
          Download the file "DiscoverScheduledTasks.ps1", and transfer the file in my directory agent.
          I've change the path subsforlders, and i've put this :

          $path = "\examplefolder\","\examplefolder\examplesubfolder \"

          $path = "\C:\","\C:\TachesPlanifie\"

          And i've add the wolling line in the Zabbix agent :

          EnableRemoteCommands=1
          UnsafeUserParameters=1
          UserParameter=TaskSchedulerMonitoring[*],powershell -NoProfile -ExecutionPolicy Bypass -File " C:\zabbix_agents_3.2.0.win\conf\DiscoverScheduledT asks.ps1" "$1" "$2"

          And that's all.

          Comment

          • kaspars.mednis
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2017
            • 349

            #6
            ok, now i see ....
            You did it all right, but have you added the template to zabbix ?



            I have attached the template to this post, download it and then go to

            configuration > templates and push the button "import template" on the right
            browse to the xml file and import it

            The new template will appear in the templates list, now attach it to the needed hosts

            Best regards,
            Kaspars
            Attached Files

            Comment

            • F35335C
              Junior Member
              • Oct 2017
              • 7

              #7
              Reply for Kaspars

              I've follow what you said, but i've have an another problem.

              I can't see the item using by Zabbix. What is the the purpose of the file "zbx_export_templates.xml". When i added the file in my Zabbix Template, i can see him now. And few Really great, but i don't know to use this, it's useless .. Can you explain to me how use this template that i've added.

              I can not use this template to monitoring my Tasks Scheduler on my host. When i try to add host in the list of "Discovery Task Scheduler" > Host Prototypes > Host :

              Host Name : LT0142167
              Visible Name : Test


              MESSAGE ERROR :
              ------------------------------------------------------------------------------------
              Zabbix cannot add host prototype : "–Host name for host prototype "LT0142167" must contain macros."
              ------------------------------------------------------------------------------------

              I think my configuration on my Power Shell script can not be bad.

              I put the path of my directory for monitoring the tasks Scheduler.

              Comment

              • F35335C
                Junior Member
                • Oct 2017
                • 7

                #8
                Reply for Kaspars

                i have attached an image for show you my problem when i go on my discovery rules on my host.
                Attached Files

                Comment

                • kaspars.mednis
                  Senior Member
                  Zabbix Certified Trainer
                  Zabbix Certified SpecialistZabbix Certified Professional
                  • Oct 2017
                  • 349

                  #9
                  Hello !

                  How large is your timeout in /etc/zabbix/zabbix_server.conf ?

                  ### Option: Timeout
                  # Spend no more than Timeout seconds on processing
                  #
                  # Mandatory: no
                  # Range: 1-30
                  # Default:
                  # Timeout=3

                  default 3 may be not enough for powershell scripts...
                  try to increase it to 10 for testing purposes
                  you must remove the # before the line
                  and then change to Timeout=10

                  and do not forget to restart zabbix_server after that, it reads configuration only on start

                  Regards,
                  Kaspars

                  Comment

                  • F35335C
                    Junior Member
                    • Oct 2017
                    • 7

                    #10
                    Reply for Kaspars

                    It's okay i've found where is my problem. Now i've an another one problem ..

                    When i go on my Dashboard of Zabbix :

                    Configuration > Hosts > "PC Julien" > Discovery Rules

                    > Discovery Task Scheduler ( i've a message error showing "Value should be a Json Object" )

                    Thank for your help Kaspars.

                    Best regards,
                    Attached Files

                    Comment

                    • kaspars.mednis
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Oct 2017
                      • 349

                      #11
                      zabbix expects JSON format object for autodiscovery, so your powershell script after execution must return JSON.

                      one way to troubleshoot it is to execute the ps1 script with all the parameters on your windows system and see the output.

                      Comment

                      • F35335C
                        Junior Member
                        • Oct 2017
                        • 7

                        #12
                        Reply for Kaspars

                        I have understand what do you want to say but i dont know how modificate the script .. Have you a idea ?

                        I have attached the script power shell if you want to see this. So you can try to convert the result of the PS in JSon for monitoring host.

                        I found on the subject some results if you want to check it i share them.

                        Link :

                        The ConvertTo-Json cmdlet converts any .NET object to a string in JavaScript Object Notation (JSON) format. The properties are converted to field names, the field values are converted to property values, and the methods are removed. You can then use the ConvertFrom-Json cmdlet to convert a JSON-formatted string to a JSON object, which is easily managed in PowerShell. Many web sites use JSON instead of XML to serialize data for communication between servers and web-based apps. This cmdlet was introduced in Windows PowerShell 3.0.


                        Tank for your help bro !
                        Attached Files
                        Last edited by F35335C; 17-10-2017, 14:21.

                        Comment


                        • roberto1890
                          roberto1890 commented
                          Editing a comment
                          Hi,

                          Were you able to solve this problem?
                      Working...