Ad Widget

Collapse

Parameters transfer to user-defined monitoring functions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • disparo
    Junior Member
    • Sep 2005
    • 29

    #1

    Parameters transfer to user-defined monitoring functions

    Hello!

    I added a function to zabbix_agentd.conf file:

    UserParameter=chksrvc[sender],chksrvc.sh sender

    it checks my 'sender' service. for 'broker' service i need to add another string, i.e.

    UserParameter=chksrvc[broker],chksrvc.sh broker

    but it seems tedious to add lines for each service!

    It seems to be great, if users can transfer function arguments to their own functions for this scheme:

    User adding an item like : chksrvc[<argument>], and in zabbix_agentd.conf file writes:

    UserParameter=chksrvc[<argument>],chksrvc.sh <argument>

    or something.
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,

    Actually it does work that way. Based on your example, you would use;
    Code:
    UserParameter=chksrvc[*],chksrvc.sh $1
    Additionally, you can pass up to 8 more command line arguments using $2-$9
    Unofficial Zabbix Developer

    Comment

    • disparo
      Junior Member
      • Sep 2005
      • 29

      #3
      Originally posted by James Wells
      Greetings,

      Actually it does work that way. Based on your example, you would use;
      Code:
      UserParameter=chksrvc[*],chksrvc.sh $1
      Additionally, you can pass up to 8 more command line arguments using $2-$9
      Thanks, James! But this option wasn't described in docs yet...

      Comment

      • Nate Bell
        Senior Member
        • Feb 2005
        • 141

        #4
        Take a look here in the section titled Flexible and non-flexible parameters. I believe Alexei has extended this further to allow several parameters to be passed to the UserParameter.

        That section is a bit buried, but I find it to be one of the most important features of UserParameters, so maybe it should be made clearer in the documentation.

        Nate

        Comment

        Working...