[Nagiosplug-help] i need help with check_mysql?

Jonathan Angliss jon at netdork.net
Wed May 11 07:26:01 CEST 2011


Find the definition for this plugin call, should look something like this:

define command {
     command_name   check_mysql
     command_line   ......
}

The command_line bit is the important bit.  That defines how the command 
is being executed. Once you've found those, you'll want to read how 
command and service definitions interact with each other:

http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#command
http://nagios.sourceforge.net/docs/3_0/objectdefinitions.html#command

The ! is an argument separator.  Say the command_line looks like this:

check_mysql -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -d $ARG3$

Your service definition should look like this:

   check_command   check_mysql!username!password!mysql

What seems to be happening is you're mixing up the understanding of 
plugins (the actual executable on your system), with the command 
definition in the .cfg file.

I hope that helps you better understand, or at least head in the right 
direction.

-- 
Jon Angliss

On 05/05/11 04:51, The Sinner wrote:
> did as in the manual but still no luck at all.
>
> check this:
>
> :/usr/lib/nagios/plugins$ ./check_mysql -u nagios -p mypass
> Uptime: 93  Threads: 1  Questions: 198  Slow queries: 0  Opens: 1069
> Flush tables: 1  Open tables: 64  Queries per second avg: 2.129
>
> the command works fine when i run it on console.
>
> but it doesn't work when i define it in my services.cfg:
>
> *> check_mysql!-H localhost -d mysql -u nagios -p mypass
> **> check_mysql!-H localhost!-d mysql!-u nagios!-p mypass*
>
> i think something wrong with the syntax above. which one is correct?
> both wrong? what is all "!" about?
>
>
> On Thu, May 5, 2011 at 1:35 AM, John Lewis
> <lewilists at gmail.com
> <mailto:lewilists at gmail.com>> wrote:
>
>     Reading http://dev.mysql.com/doc/refman/5.1/en/adding-users.html it
>     seems like the user for nagios at localhost needs to be created in the
>     database you are trying to grant it access to.
>
>     Did you create the user nagios at localhost in the database?
>
>     Lewis
>
>     On May 4, 2011, at 3:16 PM, The Sinner wrote:
>
>>     hi all,
>>
>>     i receive *access denied for user 'nagios'@'localhost' (using
>>     password no)* error.
>>
>>     what i did so far:
>>
>>     logged in to mysql and selected mysql database then:
>>     > grant all privileges on *.* to 'nagios'@'localhost' identified
>>     by 'mypass';
>>     > flush privileges;
>>
>>     then wrote a service to run the check_mysql command.
>>
>>     the service is like:
>>
>>     ...
>>     ... *check_mysql!-H localhost -d mysql -u nagios -p mypass*
>>     ...
>>
>>     how should i modify the bold part in my service definition not to
>>     receive the error above? do i miss something or write a wrong
>>     check_mysql service command?
>>
>>     thanks in advance.
>>
>>     --
>>     The Sinner
>>     ------------------------------------------------------------------------------
>>     WhatsUp Gold - Download Free Network Management Software
>>     The most intuitive, comprehensive, and cost-effective network
>>     management toolset available today.  Delivers lowest initial
>>     acquisition cost and overall TCO of any competing solution.
>>     http://p.sf.net/sfu/whatsupgold-sd_______________________________________________
>>     Nagiosplug-help mailing list
>>     Nagiosplug-help at lists.sourceforge.net
>>     <mailto:Nagiosplug-help at lists.sourceforge.net>
>>     https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
>>     ::: Please include plugins version (-v) and OS when reporting any
>>     issue.
>>     ::: Messages without supporting info will risk being sent to /dev/null
>
>
>     ------------------------------------------------------------------------------
>     WhatsUp Gold - Download Free Network Management Software
>     The most intuitive, comprehensive, and cost-effective network
>     management toolset available today.  Delivers lowest initial
>     acquisition cost and overall TCO of any competing solution.
>     http://p.sf.net/sfu/whatsupgold-sd
>     _______________________________________________
>     Nagiosplug-help mailing list
>     Nagiosplug-help at lists.sourceforge.net
>     <mailto:Nagiosplug-help at lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
>     ::: Please include plugins version (-v) and OS when reporting any issue.
>     ::: Messages without supporting info will risk being sent to /dev/null
>
>
>
>
> --
> The Sinner
>
>
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today.  Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
>
>
>
> _______________________________________________
> Nagiosplug-help mailing list
> Nagiosplug-help at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagiosplug-help
> ::: Please include plugins version (-v) and OS when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null






More information about the Help mailing list