Ad Widget

Collapse

monitoring windows applications

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jojo
    Member
    • Jul 2006
    • 57

    #1

    monitoring windows applications

    Hey folks, is there a way i can monitor whether an application is running?

    i'm using zabbix server/agent version 1.4.4.

    proc_cnt doesn't seem to be supported and i can't use service_state because the application doesn't have a service associated with it.

    Any suggestions?
  • vinny
    Senior Member
    • Jan 2008
    • 145

    #2
    write a .vbs to check if a service is running
    -------
    Zabbix 1.8.3, 1200+ Hosts, 40 000+ Items...zabbix's everywhere

    Comment

    • trikke
      Senior Member
      • Aug 2007
      • 140

      #3
      Hi,

      some of my thoughts:

      Is there a command to check if the application is running ( run the command as system.run[])?
      Does the application uses a TCP/Port ( check if zabbix can connect to the port).
      Depending on the flavour of your Windows use "tasklist" or "tlist" or whatever is installed to get a list of running processes ( again check with syste.run[]) or use "wmic" as interface ( check wmic documentation e.g "wmic PROCESS LIST BRIEF" or "WMIC PROCESS WHERE Name="explorer.exe"", again within system.run[] )

      Greets
      Patrick

      Comment

      • jojo
        Member
        • Jul 2006
        • 57

        #4
        Originally posted by vinny
        write a .vbs to check if a service is running
        theres built in support for service status checking and i have no idea about how to write a vb script. and having to deploy it could be a pain. . i'm trying to avoid that if at all possible. I'm not sure why zabbix doesn't already support this ability, you'd think people would want to know if application xyz is running.

        running system.run["tasklist /FI \"IMAGNAME eq cmd.exe\" /FI \"STATUS eq running\""]

        that got me:
        Code:
        system.run[tasklist /FI "IMAGENAME eq cmd.exe"  /FI \"STATUS eq running\""]  [t|
        Image Name                   PID Session Name     Session#    Mem Usage
        ========================= ====== ================ ====================
        cmd.exe             3284 Console                 0     48,828 K]
        adding /NH and /FO CSV allows me narrow down the info

        Code:
        C:\Program Files\Zabbix Agent>zabbix_agentd.exe -c zabbix_agentd.conf -t system.
        run["tasklist /NH /FI \"IMAGENAME eq cmd.exe\" /FI \"STATUS eq running\"
         /FO CSV"]
        system.run[tasklist /NH /FI "IMAGENAME eq cmd.exe" /FI "STATUS eq runnin
        g" /FO CSV]  [t|
        "cmd.exe","3284","Console","0","48,840 K"]
        I haven't thought of a way to get the useful bits into zabbix just yet.

        Comment

        • SMB
          Member
          • Sep 2007
          • 30

          #5
          We have a check to see if a batch processing application is running on a windows server. The application unfortunately doesn't run as a service. It is a vbscript that I found, it's not mine all I did is make some changes. The zabbix end uses system.run and takes a numeric return.

          Zabbix end:
          system.run[c:\windows\system32\cscript //B //T:05 "C:\Program Files\Zabbix\wmi_processes3.vbs" <name of executable>]

          wmi_processes3.vbs:

          Code:
          sProcessName = Wscript.Arguments(0)
          
          
          sComputer = "."    ' use "." for local computer
          Set oWmi = GetObject("winmgmts:" _
             & "{impersonationLevel=impersonate}!\\" & sComputer & "\root\cimv2")
          
          
          Set oShell = CreateObject("WScript.Shell")
          
          
          Set colProcessList = oWmi.ExecQuery ("Select * from Win32_Process Where Name = '" & sProcessName & "'")
          
          If colProcessList.Count = 0 Then
          	
          	WScript.StdOut.Write 1
          
          else
          	WScript.StdOut.Write 0
          
          End If

          Comment

          • thohell
            Junior Member
            • May 2008
            • 3

            #6
            Two simple solutions.

            Here are two simple solutions that will return the number of running instances of a specific application to zabbix. Since we are talking about windows-systems, the searches are case-insensitive. Neither of these solutions require the distribution of any files to the client. Nor do they, as far as i can tell, require wsh to be installed and configured to allow unsigned scripts.

            Solution 1:
            Use wmic.exe to return one line of text for every instance of cmd.exe running on the system. Then use find.exe to count the number of returned lines including a dot (ie. exclude header/empty lines)

            system.run["wmic.exe process where Name=""cmd.exe""|find ""."" /c"]

            Solution 2:
            Use tasklist.exe to return all running instances formatted as a csv. Then use find.exe to count every instance of "cmd.exe"

            system.run["tasklist.exe /nh /fo csv|find.exe """cmd.exe""" /c /i"]

            Comment

            • csf
              Senior Member
              • Nov 2007
              • 154

              #7
              Hi,

              I want to have the Applications-Control in Windows.

              zabbix_agentd.conf:
              UserParameter=Aircargo,tasklist /V|find /i /c "Application-Name-Examlple"
              If I start in Windows C:\Programme\ZabbixAgent>zabbix_agentd -c zabbix_agentd.conf -p,
              the answer is:
              .........................
              Aircargo [t|1]
              But if I start from zabbix_server
              ./zabbix_get -s172.16.1.182 -kAircargo
              0
              the antwort is always 0,
              zabbix_agentd.log:
              .................
              488:20080610:130535 Requested [Aircargo]
              488:20080610:130535 Before
              488:20080610:130535 Run remote command [cmd /C "tasklist /V|find /i /c "Mozilla""] Result [1] [0]...
              488:20080610:130535 Sending back [0]
              ................................................

              Please help!
              It is very necessary for me!

              Leonid.









              Also, i have 1 time Applications "Mozilla"
              In zabbix_agentd.conf:
              UserParameter=Aircargo,C:\programme\zabbixAgent\ai rcargo.bat

              Comment

              • bengaraf
                Junior Member
                • Jan 2010
                • 2

                #8
                Hi

                When running this command on the latest zabbix agent:
                system.run["wmic.exe process where Name=""cmd.exe""|find ""."" /c"]

                I get this error in the agent's log:
                828:20100121:150910.984 Run remote command [cmd /C "wmic.exe process where Name=prowin32.exe|find bsstart.r /C"] Result [123] [FIND: Parameter form]...
                3828:20100121:150910.984 Sending back [FIND: Parameter format not correct

                Node - T140


                ERROR:


                Code = 0x80041017


                Description = Invalid query


                Facility = WMI]
                1412:20100121:150911.031 Processing request.


                I enabled the parameter EnableRemoteCommands. I realy don't know what could be the problem. When running this command directly into a dos box, it runs fine...

                Comment

                • RavenD
                  Junior Member
                  • Feb 2008
                  • 1

                  #9
                  I need to set up something similar in the near future, and just ran in to the same error message you had when I was doing some testing with an XP desktop box. I found a solution - at the very end of the zabbix_agentd.conf file is a section for User-Defined monitoring parameters.
                  I added the line
                  Code:
                  UserParameter=system.test,wmic.exe process where name="firefox.exe" | find "." /c
                  to the end of the file, and set the item key to system.test in zabbix. Works perfectly, no errors.

                  Comment

                  • bengaraf
                    Junior Member
                    • Jan 2010
                    • 2

                    #10
                    Tnx, works indeed perfectly

                    Comment

                    • Anth0ny
                      Member
                      • Nov 2009
                      • 85

                      #11
                      Originally posted by bengaraf
                      Hi

                      When running this command on the latest zabbix agent:
                      system.run["wmic.exe process where Name=""cmd.exe""|find ""."" /c"]

                      I get this error in the agent's log:
                      828:20100121:150910.984 Run remote command [cmd /C "wmic.exe process where Name=prowin32.exe|find bsstart.r /C"] Result [123] [FIND: Parameter form]...
                      3828:20100121:150910.984 Sending back [FIND: Parameter format not correct

                      Node - T140


                      ERROR:


                      Code = 0x80041017


                      Description = Invalid query


                      Facility = WMI]
                      1412:20100121:150911.031 Processing request.


                      I enabled the parameter EnableRemoteCommands. I realy don't know what could be the problem. When running this command directly into a dos box, it runs fine...
                      system.run["wmic.exe process where Name=^"^"cmd.exe^"^"^|find ^"^".^"^" /c"]

                      Comment

                      • Anth0ny
                        Member
                        • Nov 2009
                        • 85

                        #12
                        Originally posted by MANKY
                        Dear Friends,

                        I am using zabbix version 1.8.4 and would like to monitor navision server via zabbix agent. Can somone please let me know what all parameters can be monitored for navision server.

                        Thanks
                        Manky
                        Your question is strange. And you chose starnge topic.

                        If you say what is "navision server" and what kind of services it have - we probably can help you.

                        Comment

                        • Anth0ny
                          Member
                          • Nov 2009
                          • 85

                          #13
                          mate, Zabbix documentation is very useful.

                          OS? What do you mean?
                          Users sessions in OS?
                          Services... Windows services?

                          Comment

                          • MANKY
                            Junior Member
                            • Apr 2012
                            • 3

                            #14
                            Originally posted by Anth0ny
                            mate, Zabbix documentation is very useful.

                            OS? What do you mean?
                            Users sessions in OS?
                            Services... Windows services?
                            Dear, i was actually trying to monitor fin.exe instance and not able to get the proper results.

                            Comment

                            • Anth0ny
                              Member
                              • Nov 2009
                              • 85

                              #15
                              Originally posted by MANKY
                              Dear, i was actually trying to monitor fin.exe instance and not able to get the proper results.
                              no problem mate =)

                              do you want to know "my fin.exe is running" ?

                              item: proc.num[fin.exe]
                              trigger: proc.num[fin.exe].last(0)}<1

                              if number of instances <1 - fin.exe not running now. trigger ERROR.

                              Comment

                              Working...