Ad Widget

Collapse

UserParamater's Delimiting $1 Variables....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • edeus
    Senior Member
    • Aug 2005
    • 120

    #1

    UserParamater's Delimiting $1 Variables....

    I have the following statement:

    UserParameter=myitem,ps auxw | awk '$5 ~ /^[0-9]*$/ { s+= $5} END {print s}'

    The parameter's $5 are getting passed even though they are null.

    I tried delimiting with all combinations I could think of, but nothing works.

    the only way around this is to have a script but this is a real nuisance and not very pretty.

    another option I had was to use nested ...`echo $`5... but that is seriously dodgy also.

    Can anyone help me please???
  • edeus
    Senior Member
    • Aug 2005
    • 120

    #2
    Multiple $1 $2... Parameters

    Also,

    Multiple parameters do not appear to be working.

    UserParameter=areca[],/usr/local/sbin/areca-info $1 $2

    Called via ... -k"areca[raidinfo,1]" and gives me ZBX_NOTSUPPORTED.

    I have tried various things to get it working, in a test parameter it worked once but I couldnt change it's syntax nor could I establish a reason why it was working and this one above wasnt.

    Wasted enough time trying to figure this one out, i hope someone else got a little further or could explain why this is happening.

    Comment

    • alphamerik
      Junior Member
      • Dec 2005
      • 3

      #3
      Edeus,

      I think you are missing the *, maybe it should be:

      UserParameter=areca[*],/usr/local/sbin/areca-info $1 $2

      Let me know if this works...

      Comment

      • edeus
        Senior Member
        • Aug 2005
        • 120

        #4
        From speculation/other user's responses, the documentation/notes are incorrect. It currently works without any * in the brackets [].

        I think I tried this just in case though

        Comment

        • edeus
          Senior Member
          • Aug 2005
          • 120

          #5
          Revision 1.914 - (view) (download) (annotate) - [select for diffs]
          Thu Dec 15 09:11:00 2005 UTC (4 days, 13 hours ago) by osmiy
          Branch: MAIN
          CVS Tags: HEAD
          Changes since 1.913: +3 -0 lines
          Diff to previous 1.913

          - fixed system.swap.size (Eugene)
          - fixed vm.memory.size (Eugene)
          - fixed configuration file parsing for user specifed functions (Eugene)

          Looks there are a few things that are fixed (all of which I have noticed/had problems with).

          Comment

          • edeus
            Senior Member
            • Aug 2005
            • 120

            #6
            Yes! Multiple parameters works again!

            I cant say I like using the CVS version. I hope they fix the ping issue soon, it probably would be easy enough to fix by hand though.

            Fixed problem with using $6 etc nested variables by adding a space, awk doesnt seem to care.

            Comment

            Working...