Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: [RESOLVED]check_mysql_health plugin - problem with macros

  1. #1
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    [RESOLVED]check_mysql_health plugin - problem with macros

    Hello.
    All checks that use this plugin, fail with message:
    Code:
    CRITICAL - cannot connect to information_schema. Access denied for user 'xyz'@'ocsdebian.eta-cerkno.si' (using password: YES)
    xyz=value from macros ($MYSQLUSER$).
    If I run check from terminal, it goes OK.
    Code:
    ./check_mysql_health --hostname localhost --username xyz --password yzx --mode uptime
    Looks like the check_mysql_health doesn't recieve $MYSQLPASSWORD$ value??

    Is anyone else experiencing this problem? :

  2. #2
    Senior Member
    Join Date
    Nov 2011
    Posts
    147

    Re: check_mysql_health plugin - problem with macros

    Donne la conf de ton service et de la check_command plz.
    Vérifie aussi qu'il n'y a pas de typo sur le nom des variables.


    ---------------------------

    Can you give us the definition of your service and the associated command.
    Can you also check that there is no typo on variable name.





  3. #3
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: check_mysql_health plugin - problem with macros

    Uf, glad to have translation tools around
    In English please (I'm from Slovenia).

    service - restart.cfg
    macros - username and password (of course I deleted actual password and username, but I triple-checked for a typo)
    commands - all the commands for mysql database, included in default install.

    That said, in default shinken installation I only modified:
    • [li]macros.cfg - entered uname and password[/li]
      [li]compiled check_mysql_health plugin and installed it in /usr/lib/nagios/plugins[/li]
      [li]on host definition that has mysql database installed I added "mysql" in use generic-host, linux,... line[/li]


    I hope it is just a typo , though I have checked

  4. #4
    Administrator
    Join Date
    Jun 2011
    Posts
    216

    Re: check_mysql_health plugin - problem with macros

    Hi,

    To be sure that the macro is not evaluated properly, juste create a script that return args
    Something like echo $* ; exit 0 may be enough
    Then create a service and a command. And use the macro in the command to see if it's fine.

    I think the macro is ok in fact. Can you check your mysql conf? (/etc/mysql/my.cnf)
    Check that you have :
    Code:
    #bind-address [...]
    This field must be commented if you are connecting to mysql in a non-local way

  5. #5
    Senior Member
    Join Date
    Nov 2011
    Posts
    147

    Re: check_mysql_health plugin - problem with macros

    add the command
    Code:
    env
    in your script to check the environnement varaibles.

  6. #6
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: check_mysql_health plugin - problem with macros

    Code:
    #bind-address [...]
    I have it commented out, since I input in this database from several locations, so that's not a problem.
    By the way, I have shinken on the same host as mysql server.

    I don't understand env. I mean, I know it displays environment variables, but should all shinken macros be visible with env command?
    For example, $MYSQLPASSWORD$= zxy, should env return value of MYSQLPASSWORD? That's probably not true, as it is not safe

    in which script should I add this command? check_mysql_health?

  7. #7
    Administrator
    Join Date
    Jun 2011
    Posts
    216

    Re: check_mysql_health plugin - problem with macros

    The script I told you to create

    Do it and create a fake service/host if necessary to check if this work or not

  8. #8
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: check_mysql_health plugin - problem with macros

    I'm just in process of moving Shinken to physical server from virtual machine (for performance reasons, and for notifications via mobile phone). As soon as I will have time I will get back on this problem.
    Thank you for now.

  9. #9
    Member
    Join Date
    Feb 2012
    Location
    Slovenia
    Posts
    65

    Re: check_mysql_health plugin - problem with macros

    Uf... :-[

    I found out, that check_mysql_health adds domain to username.
    I resolved this problem by simply creating new user in mysql database and allow it to access from anywhere.
    Then of course I used this new username and password in mysql macro and it is working ;D

    Going to next problem, this one is resolved.
    Thanks for help.

  10. #10
    Member
    Join Date
    Jun 2012
    Location
    France
    Posts
    52

    Re: [RESOLVED]check_mysql_health plugin - problem with macros

    According to the wiki page on that topic

    http://www.shinken-monitoring.org/wiki/monitoring_mysql

    In section "Setup the mysql user account", the following statement appear to be wrong:

    Code:
    GRANT usage ON *.* TO 'shinken'@'*' IDENTIFIED BY 'shinkenpassword';
    i replaced it by:
    Code:
    GRANT USAGE ON *.* TO 'shinken'@'%' IDENTIFIED BY 'shinkenpassword';
    It works fine now

Posting Permissions

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