[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [monit] Using monit to monitor mythbackend
From: |
Martin Pala |
Subject: |
Re: [monit] Using monit to monitor mythbackend |
Date: |
Tue, 13 Nov 2007 22:03:47 +0100 |
it could be related to the environment variables setup. Monit starts
programs with minimal sandbox environment - basically it overrides
PATH and sets monit specific variables which describe the event:
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
MONIT_EVENT
MONIT_SERVICE
MONIT_DATE
MONIT_HOST
MONIT_PROCESS_PID
MONIT_PROCESS_MEMORY
MONIT_PROCESS_CHILDREN
MONIT_PROCESS_CPU_PERCENT
It is possible that you use some env. variable in your mythbackend
startup script or the mythbackend itself requires such variable,
whereas it is not set when starting via monit.
To solve this, you can add the variables to mythbackend startup script.
Martin
On Nov 11, 2007, at 8:51 PM, John wrote:
I'm trying to monitor mythbackend with monit without
success. I'm using Fedora 8 and I downloaded a package
found on rpm.pbone. The package said it was for Fedora
8 but the package name has a f7. Don't know if this is
a problem. I was a bit confused on the difference
between /etc/monit.conf and monitrc file so I made a
backup of the monit.conf file and used this as my
monit.conf so I'm not sure if this is causing my
issue.
# Monit control file
#
# Comments begin with a '#' and extend through the end
of the line.
# Blank lines between program entries are ignored.
Keywords are case
# insensitive. All path's MUST BE FULLY QUALIFIED,
starting with '/'
#
set daemon 30
set logfile /var/log/monit.log
admin on any event
set httpd port 2812 and
allow localhost
allow 127.0.0.1
allow user:xxxx
check process mythbackend with pidfile
/var/run/mythtv/mythbackend.pid
group mythtv
start program = "/etc/init.d/mythbackend restart"
as uid mythtv and gid mythtv
stop program = "/etc/init.d/mythbackend stop"
as uid mythtv and gid mythtv
if failed port 6544 proto http then restart
mode manual
depends on mysql
check process mysql with pidfile
/var/run/mysqld/mysqld.pid
group mythtv
start program = "/etc/init.d/mysqld start"
stop program = "/etc/init.d/mysqld stop"
if failed port 3306 then restart
mode manual
So I start my mythbackend as
[mythtv]$ /etc/rc.d/init.d/mythbackend start
I then log into the monit web page and click enable
monitoring. I then kill the mythbackend process with
the kill command and then check to see if monit
restarts. It tires but gives me these errors.
[MST Nov 11 10:47:23] info : 'mythbackend' trying
to restart
[MST Nov 11 10:47:23] debug : Monitoring disabled
-- service mythbackend
[MST Nov 11 10:47:23] debug : monit: pidfile
'/var/run/mythtv/mythbackend.pid' does not exist
[MST Nov 11 10:47:23] debug : monit: pidfile
'/var/run/mythtv/mythbackend.pid' does not exist
I look in my mythbackend log and I see these errors.
2007-11-11 10:57:44.341 Using runtime prefix = /usr
2007-11-11 10:57:44.348 Unable to read configuration
file mysql.txt
2007-11-11 10:57:44.348 Trying to create a basic
mysql.txt file
2007-11-11 10:57:44.349 Could not create //.mythtv
2007-11-11 10:57:44.350 Failed to init MythContext,
exiting.
I don't understand why I can start mythbackend from
the command line but when monit tries the exact same
command it gives me the mysql.txt error.
Anyone know what I'm doing wrong?
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general