Ad Widget

Collapse

Very Simple Trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • richard
    Junior Member
    • Jan 2007
    • 4

    #1

    Very Simple Trigger

    Hello,

    Just wondering if anyone can help? Looking for a trigger to check if a certain process if running on any of our Windows 2003 servers.

    Many thanks in advance,

    Richard
  • richard
    Junior Member
    • Jan 2007
    • 4

    #2
    Any update would be much appreciated.

    Kind Regards,

    Richard

    Comment

    • dsipe
      Senior Member
      • Oct 2006
      • 184

      #3
      May be U can use the gnu tools for win32 to issue some kind of unix command like 'ps -ef|grep -i process' inside a .BAT or .CMD [ http://gnuwin32.sourceforge.net/ ]

      then create a UserParameter inside zabbix_agentd.conf and define a specific item.

      From there, U can define a trigger using the 'str' function to find your process

      Comment

      • sbadger
        Member
        • Dec 2005
        • 81

        #4
        Is it a service that is running??

        Comment

        • richard
          Junior Member
          • Jan 2007
          • 4

          #5
          sbadger,

          No the trigger is needed to check if a program called "SourceBooster.exe" is running on the server or not.

          Kind Regards,

          Richard

          Comment

          • sbadger
            Member
            • Dec 2005
            • 81

            #6
            Then Dsipe has the best method.
            I don't kow of anyway to poll running programs otherwise.

            Sorry

            Comment

            • dantheman
              Senior Member
              • May 2006
              • 209

              #7
              I put together this VBS script that will tell you how many of a particular process are running. We have a program that needs to be running on a computer and we use it for that.

              I have an item in zabbix

              system.run[cscript c:\howmany.vbs processname.exe //nologo]

              Doing it as a system command eliminates the need to have a userparameter . or of having to make copies of the script for each process on that server that needs to be monitored. the only limitation I've come across is that zabbix only stores a certain length of the key, so if your path to the vbs script is too long, then it won't all be saved in zabbix and the script won't be run by zabbix. That's why you see I have the script right on the C drive to keep the path as short as possible.

              Then I created a trigger that checks if this item is = to 1. If it is.. things are good to go, but if not.. then we have a problem.

              howmany.vbs
              Code:
              DIM strProcessName
              
              If Wscript.Arguments.Count > 0 Then
              strProcessName = wscript.arguments(0)
              wscript.echo howmany
              else
              wscript.echo "ERROR"
              end if
              
              Function HowMany()
                Dim Proc1,Proc2,Proc3
                Set Proc1 = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
                Set Proc2 = Proc1.ExecQuery("select * from win32_process" )
                HowMany=0
                For Each Proc3 in Proc2
              	If LCase(Proc3.Caption) = strProcessName Then
              	  HowMany=HowMany + 1
              	End If
                Next
              End Function
              Last edited by dantheman; 08-01-2007, 16:51.

              Comment

              • richard
                Junior Member
                • Jan 2007
                • 4

                #8
                Many thanks for your responce. Would it be possible for you to paste the trigger you used?

                Kind Regards,

                Richard

                Comment

                • ad@kbc-clearing.com
                  Member
                  • Sep 2005
                  • 77

                  #9
                  proc.num[SourceBooster.exe]
                  does the trick.
                  no need for vbs scripts.

                  Comment

                  • dantheman
                    Senior Member
                    • May 2006
                    • 209

                    #10
                    Hey thanks for the info on proc.num that will help clean up the monitoring.

                    Comment

                    • dratliff
                      Member
                      • May 2007
                      • 40

                      #11
                      trigger

                      I would really like to see how to make a trigger. I have cut and paste a simple example that is part of the windows_t, but I cannot figure out how to monitor a process.

                      Any help would be appreciated. Or if there is some tutorial documentation, that would be greatly appreciated.


                      Thank you in advance.

                      Comment

                      Working...