[Xymon] mysql password file on centos 5, xymon client

Jeremy Laidman jlaidman at rebel-it.com.au
Mon Dec 3 07:07:13 CET 2012


Try running this as the xymon user, to find out where it's looking for the
file:

HOME=~xymon sudo -u xymon xymoncmd strace -f mysql 2>&1 | grep ^stat

On my system:

stat("/etc/my.cnf", 0x7fff9cbc1830)     = -1 ENOENT (No such file or
directory)
stat("/usr/lib/xymon/.my.cnf", 0x7fff9cbc1830) = -1 ENOENT (No such file or
directory)
stat("/etc/my.cnf", 0x7fff9cbc1830)     = -1 ENOENT (No such file or
directory)




On 30 November 2012 00:43, Leon Volfson <leon at one.co.il> wrote:

> Hi Mike,
> thanks for answering,
> I did run the "whereis xymon-client" and I do know about this directory.
> unfortunately, putting the file there doesn't do anything.
>
>
> Lenny
>
>
> On Thu, Nov 29, 2012 at 2:50 PM, Mike Burger <
> Mike.Burger at freedommortgage.com> wrote:
>
>> Oops…client…if you installed it from RPM, the home dir is likely
>> /usr/share/xymon-client.****
>>
>> ** **
>>
>> *From:* xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] *On
>> Behalf Of *Mike Burger
>> *Sent:* Thursday, November 29, 2012 7:49 AM
>> *To:* Leon Volfson; xymon at xymon.com
>> *Subject:* Re: [Xymon] mysql password file on centos 5, xymon client****
>>
>> ** **
>>
>> Leon,****
>>
>> ** **
>>
>> If you installed Xymon from RPM on your CentOS 5 system, and you run
>> either “finger xymon” or “grep xymon /etc/passwd”, you’ll likely note that
>> the xymon user’s home directory is /usr/lib/xymon. Try creating/moving the
>> .my.cnf there.****
>>
>> ** **
>>
>> *From:* xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com<xymon-bounces at xymon.com>]
>> *On Behalf Of *Leon Volfson
>> *Sent:* Wednesday, November 28, 2012 7:21 AM
>> *To:* xymon at xymon.com
>> *Subject:* [Xymon] mysql password file on centos 5, xymon client****
>>
>> ** **
>>
>> Hi,
>>
>> I have a question.
>> Recently I've added a script to monitor the mysql replication.
>> I got it off the internet:
>>
>> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
>> #!/bin/bash
>>
>>
>>
>> ############################################################################################
>> test -e /usr/local/mysql/bin/mysql && PROG=/usr/local/mysql/bin/mysql
>> test -e /usr/bin/mysql && PROG=/usr/bin/mysql
>> MAXDRIFT=5
>>
>> ############################################################################################
>>
>> MYSQLCOLOR=""
>> MYSQLLINE=""
>> HOSTIP=127.0.0.1
>> IPADDR=127.0.0.1
>> MACHINE=`uname -n`
>>
>> MAXSEC=60
>>
>> MYSQLUSER=root
>> MYSQLPORT=3306
>> LINE=`echo "show slave status \G" | ${PROG} -h ${HOSTIP} -u ${MYSQLUSER}
>> -P ${MYSQLPORT} 2>&1`
>> MASTERPOS=`echo $LINE | grep Read_Master_Log_Pos | awk -F
>> 'Read_Master_Log_Pos: ' '{print $2}' | awk '{print $1}'`
>> SLAVEPOS=`echo $LINE | grep -i Exec_Master_Log_Pos | awk -F
>> 'Exec_Master_Log_Pos: ' '{print $2}' | awk '{print $1}'`
>> SLAVEUP=`echo $LINE | grep Running | wc -l`
>> SLAVE_SECOND_BEHIND_MASTER=`echo $LINE | grep 'Seconds_Behind_Master:'  |
>> awk -F 'Seconds_Behind_Master: ' '{print $2}'  | awk '{print $1}'`
>> test $SLAVEUP -eq "1"  &&  DRIFT=$((${MASTERPOS} - ${SLAVEPOS}))
>> echo "${LINE}" | ${GREP} "Running: No" >/dev/null
>> if test "$?" -eq "0"
>> then
>>     MYSQLCOLOR="red"
>>     MYSQLLINE="`${DATE}` MYSQL Slave in error
>> ${LINE}"
>> elif test ${SLAVEUP} -ne "1"
>> then
>>     MYSQLCOLOR="green"
>>     MYSQLLINE="`${DATE}` MYSQL Slave is Stopped
>> ${LINE}"
>> elif test ${SLAVE_SECOND_BEHIND_MASTER} -ge ${MAXSEC}
>> then
>>     MYSQLCOLOR="yellow"
>>     MYSQLLINE="`${DATE}` MYSQL Slave is ${DRIFT} statements behind!
>> ${LINE}"
>> else
>>     MYSQLCOLOR="green"
>>     MYSQLLINE="`${DATE}` MYSQL Slave is ${DRIFT} statements behind!
>> ${LINE}"
>> fi
>>
>> #echo "${BB} ${BBDISP} status ${MACHINE}.mysqlslave ${MYSQLCOLOR}
>> ${MYSQLLINE}"
>> ${BB} ${BBDISP} "status ${MACHINE}.mysqlslave ${MYSQLCOLOR} ${MYSQLLINE}"
>>
>> -----------------
>>
>> To make it working, you need to create the file : ~hobbit/.my.cnf
>>
>> [mysql]
>> password=XXXXXXXX
>> [mysqlclient]
>> password= XXXXXXXX
>> [mysqladmin]
>> password= XXXXXXXX
>> [mysqlshow]
>> password= XXXXXXXX
>> [mysqldump]
>> password= XXXXXXXX
>> -------------------------------------------
>> chown hobbit: ~hobbit/.my.cnf
>> chmod 600 ~hobbit/.my.cnf
>>
>>
>> Add the section in clientlaunch.cfg
>>
>> [mysqlslave]
>>         ENVFILE $HOBBITCLIENTHOME/etc/hobbitclient.cfg
>>         CMD $HOBBITCLIENTHOME/ext/mysqlslave.sh
>>         LOGFILE $HOBBITCLIENTHOME/logs/mysqlslave.log
>>         INTERVAL 5m
>>
>>
>> Restart hobbit-client.
>>
>> ------------------------------------------------------------------------------------------------------------------------
>>
>>
>> as you can see, the author instructs to put the .my.cnf file with all the
>> passwords in the ~hobbit/.my.cnf directory.
>> While that went fine on the Ubuntu 12.04 server, it doesn't work on the
>> CentOS 5 server.
>> I got the xymon client.rpm from some website and it just doesn't
>> recognize this file no matter where I put it.
>> The version is 4.3.10.
>> the client is installed in these directories:
>> /etc/xymon-client
>> /usr/libexec/xymon-client
>> /usr/share/xymon-client
>>
>> I also noticed that there's no /var/lib/xymon-client directory.
>> The Ubuntu version was installed via apt-get and still has "hobbit"
>> naming.
>> On CentOS client I renamed all the "hobbit" into "xymon".
>> If I put the pass into the script itself - it works. But I really don't
>> want to do that.
>>
>> Any ideas?
>>
>> Thanks,
>> Lenny****
>>
>> ** **
>>
>> ** **
>>
>> CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for****
>>
>> the sole use of the intended recipient(s) and may contain confidential****
>>
>> information. Any unauthorized review, use, disclosure, alteration or****
>>
>> distribution is strictly prohibited and may violate state or federal law. If you****
>>
>> are not the intended recipient, please contact the sender by reply e-mail,****
>>
>> delete this email and destroy all copies of the message.****
>>
>> CONFIDENTIALITY NOTICE: This e-mail message, including all attachments, is for
>> the sole use of the intended recipient(s) and may contain confidential
>> information. Any unauthorized review, use, disclosure, alteration or
>> distribution is strictly prohibited and may violate state or federal law. If you
>> are not the intended recipient, please contact the sender by reply e-mail,
>> delete this email and destroy all copies of the message.
>>
>>
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20121203/b3ba45e6/attachment.html>


More information about the Xymon mailing list