Ad Widget

Collapse

Problem with Trigger Expression

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ulrike.gerhards
    Junior Member
    • Sep 2007
    • 12

    #1

    Problem with Trigger Expression

    HTML Code:
    I'm trying to monitor the Spooler length of a Printer.
    what I want is to check wether the Lenght is >10 and is not decreasing.
    
    My item key is "perf_counter[\Druckerwarteschlange(_Total)\Aufträge in Warteschlange]"
    The Trigger "{HOSTNAME:perf_counter[\Druckerwarteschlange(_Total)\Aufträge in Warteschlange].last(0)}>10" works. 
    The Trigger "{HOSTNAME:perf_counter[\Druckerwarteschlange(_Total)\Aufträge in Warteschlange].change(0)}>0" is also no Problem.
    
    However when I try to combine both Triggers by setting the Expression to
    "({HOSTNAME:perf_counter[\Druckerwarteschlange(_Total)\Aufträge in Warteschlange].last(0)}>10) & ({HOSTNAME:perf_counter[\Druckerwarteschlange(_Total)\Aufträge in Warteschlange].change(0)}>0)"
    I get an Error: 'No such monitored parameter (perf_counter[\Druckerwarteschlange(_Total)\Aufträge in Warteschlange].last(0)}>10) & ({HOSTNAME:perf_counter[\Druckerwarteschlange(_Total)\Aufträge in Warteschlange]) for host (HOSTNAME)'
    
    On other Items i can do this without any problem. Does anyone know what could be the Problem?
    
    We're Using Zabbix Server 1.4.6 with MySQL
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #2
    Hi

    My first thought was: How about german umlauts in 1.4.x ?

    However, the error message looks like that there is a syntax error somewhere
    in the trigger expression.
    Obviously, the frontend tries to find a really non-existing item.

    I can't spot in the trigger expression where the problem really is.
    Although it looks like a problem with the brackets "]", perhaps triggered by the (second) umlaut ?.

    I would first try to omit the outer parenthesis of both expressions and the spaces around the "&".
    What result shows up if you try a similar trigger expression using a different performance counter without german umlauts ?

    HTH,

    Norbert.
    Last edited by NOB; 07-08-2009, 08:14. Reason: More hints, interpreting the error message

    Comment

    • ulrike.gerhards
      Junior Member
      • Sep 2007
      • 12

      #3
      Hi Norbert,

      without the parenthesis and the spaces I get the same message.
      Using a diffenent performance Counter it works just fine. Is there a workarount for the Umlaut problem?
      Though it's strage that it works perfectly if I just use just one of the items...

      Thanks for your help

      Comment

      • NOB
        Senior Member
        Zabbix Certified Specialist
        • Mar 2007
        • 469

        #4
        Hi Ulrike

        we are using just english versions of WIndows, so we don't have
        the same problem. Therefore we don't need a workaround.

        Because the second umlaut seems to trigger the "bug", i am
        thinking about using just one expression to fulfill your request.

        There are some functions for items which combine values like
        Code:
        sum
        avg
        count
        There may be more, just look at the manual.
        Perhaps one of those can be used to get around this problem.
        Short of fixing the bug, that's the only idea I have.

        I'm sorry that I can't solve the problem for you.
        Hope that you find a solution.
        I am not sure whether this is fixed in 1.6.x, but the trigger
        function for count was changed, so that you can specify the
        number of values to inspect, e.g. #2, instead of just the time interval.

        Regards

        Norbert.

        Comment

        • bernard
          Member
          • Oct 2008
          • 54

          #5
          Using user parameter to monitor printer spooler length

          Hi Ulrike,

          I have a specific print application I can't monitor using percounters, but document are stored into a folder.
          To monitor this, I use UserParameter with a VBS script, which counts the number of files into a specific folder.

          With this system, you can monitore you print spooler without perfcounters.
          Item key : folder_files[your_folder_name,COUNT,.spl]
          agent config file : UserParameter=folder_files[*],cscript "%programfiles%\Zabbix\userparam\zbx_folder_files_ ext.vbs" "$1" $2 $3 //nologo
          VBS code is:
          Code:
          option explicit
          
          dim in_strFolder, in_strAction, in_strExt, in_intExtLen
          in_strAction="COUNT"
          in_strExt="ALL"
          
          if Wscript.Arguments.count=0 then 
          wscript.echo "-1"
          end if
          
          if Wscript.Arguments.count>=1 then 
          in_strFolder=Wscript.Arguments(0)
          end if
          
          if Wscript.Arguments.count>=2 then 
          	in_strAction=ucase(Wscript.Arguments(1))
          	if (in_strAction <> "COUNT") and (in_strAction <> "OLDEST") and (in_strAction <> "NEWEST") then
          		wscript.echo "-2"
          	end if
          end if
          
          if Wscript.Arguments.count>=3 then 
          in_strExt=ucase(Wscript.Arguments(2))
          in_intExtLen=len(in_strExt)
          end if
          
          dim ofs, ofolder, ofiles
          Set ofs = CreateObject("Scripting.FileSystemObject")
          set ofolder= ofs.getfolder(in_strFolder)
          set ofiles=ofolder.files
          
          'wscript.echo "in_strFolder="&in_strFolder
          'wscript.echo "in_strEXT="&in_strEXT
          'wscript.echo "in_strAction="&in_strAction
          
          
          if in_strAction="COUNT" and in_strEXT="ALL" then
          	intcountfiles=ofiles.count	
          else
          	dim intcountfiles, intfileagemax,intfileage,intfileagemin
          	dim ofile
          	intcountfiles=0
          	intfileage=0
          	intfileagemax=0
          	intfileagemin=999999999
          	for each ofile in ofiles
          '		wscript.echo ofile.Name
          '		wscript.echo "file ext="&ucase(right(ofile.Name,in_intExtLen)) &"="&in_strExt
          		if in_strEXT="ALL" or ucase(right(ofile.Name,in_intExtLen))=in_strExt then
          '			wscript.echo ofile.Name
          			intcountfiles=intcountfiles+1
          			intfileage=DateDiff("s",ofile.DateLastModified,now)
          			if intfileage > intfileagemax then intfileagemax=intfileage
          			if intfileage < intfileagemin then intfileagemin=intfileage
          	   end if
          	next
          end if
          
          if in_strAction="OLDEST" then
          '	  wscript.echo "OLDEST="&intfileagemax
          	  wscript.echo intfileagemax
          elseif in_strAction="NEWEST" then
          '	  wscript.echo "NEWEST="&intfileagemin
          	  wscript.echo intfileagemin
          else
          	wscript.echo intcountfiles
          end if
          I use the same script to find the older file of the spooler (OLDEST instead of COUNT) or count other type of document into a folder.

          Regards,
          Bernard

          Comment

          • NOB
            Senior Member
            Zabbix Certified Specialist
            • Mar 2007
            • 469

            #6
            Originally posted by ulrike.gerhards
            Hi Norbert,

            without the parenthesis and the spaces I get the same message.
            Using a diffenent performance Counter it works just fine. Is there a workarount for the Umlaut problem?
            Though it's strage that it works perfectly if I just use just one of the items...

            Thanks for your help
            Hi Ulrike

            I tested your case at home today and I wasn't even able to enter the
            item into the DB. Obviously, the umlauts don't work for me, at all.
            Did you do something special in your environment to be able to
            enter those special characters ?

            I modified the language in ZABBIX to be german and set the PHP charset to
            iso-8859-1.
            But still no way to even enter the item.
            The item is checked in the code by "print" and the umlauts might not
            be printable in my PHP world.

            Anyway, I know that there is a workaround by using numbers instead
            of text for performance counters.

            Here are some posts in the ZABBIX forums:




            In summary:

            You can either use the numeric version or a user parameter on the
            servers as a workaround.

            Both articles and the manual for ZABBIX 1.6 give hints.
            In that particular area it doesn't matter whether the manual is for 1.6 or 1.4.
            Using the numeric values for perf_counters does not depend on the ZABBIX
            version.

            HTH,

            Norbert.

            Comment

            • ulrike.gerhards
              Junior Member
              • Sep 2007
              • 12

              #7
              Thanks a lot for your help. I used the numeric version to get the Performance Counter values now and it works fine.

              To get the Umlaut Items into zabbix config we editet /usr/share/zabbix/include/defines.inc.php and changed ZBX_EREG_PARAMS to:
              define('ZBX_EREG_PARAMS', '(.+){0,1}');

              We Use Zabbix Server Version 1.4.5 with postgres (UTF8 encoding) right now and this was the first Problem with Umlauts.

              Thanks again for your help!

              Comment

              Working...