Results 1 to 9 of 9

Thread: could not expand all macros

  1. #1

    could not expand all macros

    For every service, the following appears at the bottom: "Note: could not expand all macros" when viewed in thruk. Is this a shinken compatibility issue?

  2. #2

    Re: could not expand all macros

    Which macros do you use? Thruk only replaces a few common macros.

  3. #3

    Re: could not expand all macros

    Well, I use different macros defined in resources.cfg. But maybe these are not transmitted via livestatus?

  4. #4

    Re: could not expand all macros

    Exactly. You have to specify your resource.cfg in the thruk_local.cfg to make that work.

  5. #5

    Re: could not expand all macros

    Aha! Ok, thanks for the tip.

  6. #6
    Junior Member
    Join Date
    Aug 2013
    Posts
    3

    Re: could not expand all macros

    I'm sorry, but it looks like i have to get up this topic.
    I have the similar problem, but the resource file definition does not help. So, i have the next situation:

    1) Shinken installation works well. The resource file is accessible for apache user by the default path:
    Code:
    # ls -la /usr/local/shinken/etc/resource.cfg
    -rw-rw-r-- 1 shinken shinken Aug 5 23:05 /usr/local/shinken/etc/resource.cfg
    2) I've defined 'resource_file' in the thruk_local.conf both ways - as a global variable and as local backend option:
    Code:
    # cat /etc/thruk/thruk_local.conf
    enable_shinken_features = 1
    graph_word = 1
    resource_file = /usr/local/shinken/etc/resource.cfg
    
    <Component Thruk::Backend>
      <peer>
        name  = External Shinken
        id   = dbd61
        type  = livestatus
        <options>
          peer     = 127.0.0.1:50000
          resource_file = /usr/local/shinken/etc/resource.cfg
        </options>
      </peer>
    </Component>
    3) I restarted the httpd and thruk services (i use mod_fcgid in my installation), configuration changes was applied successfully.

    4) But I still see the next message on host/service detailes pages:
    Code:
    Expanded Command	
    Note: could not expand all macros! 
    $PLUGINSDIR$/check_ping -H my.hostname.loc -w 3000,100% -c 5000,100% -p 1
    Code:
    Expanded Command 
    Note: could not expand all macros! 
    $PLUGINSDIR$/check_snmp_load.pl -H my.hostname.loc -C $SNMPCOMMUNITYREAD$ -f -w 2,2,2 -c 3,3,3 -T netsl
    5) Of cource, $PLUGINSDIR$ and $SNMPCOMMUNITYREAD$ are defined in the resource.cfg. And there is no error messages in any logfile.

    Please, help me to understand the reason of this issue. Why does the macros are not parsed by thruk? Is there any method to debug this issue?

  7. #7

    Re: could not expand all macros

    You can only define $USERx$ macros in your ressource file (at least in nagios). Therefore Thruk ignores everything except User Macros.

  8. #8
    Shinken project leader
    Join Date
    May 2011
    Location
    Bordeaux (France)
    Posts
    2,131

    Re: could not expand all macros

    That's because Shinken allow all macros, not just USERX. It will just define them in UPPERCASE
    No direct support by personal message. Please open a thread so everyone can see the solution

  9. #9
    Junior Member
    Join Date
    Aug 2013
    Posts
    3

    Re: could not expand all macros

    Thanks for replies.
    [quote author=naparuba link=topic=336.msg5476#msg5476 date=1376296605]
    That's because Shinken allow all macros, not just USERX. It will just define them in UPPERCASE
    [/quote]
    So, can you guess, what can be a reason of my issue?
    There are uppercase macros in resource.cfg, but Thruk does not parse them.
    Code:
    ...
    #-- Location of the plugins
    $PLUGINSDIR$=/usr/local/shinken/libexec
    ...
    #-- Discovery
    # default snmp community
    $SNMPCOMMUNITYREAD$=public
    ...
    Or, may be, should I ask this question on the Thruk forum?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •