monit interview questions
Top monit frequently asked interview questions
I have a bunch of Ruby scripts which are long running, I'd like to ensure that every 30 seconds or so these are up.
I normally start the commands by simply ruby script-name.rb
How can I configure monit to look after these scripts?
Update: I tried to follow this method to create a wrapper script which would then launch the ruby process but it did not seem to create the .pid file and typing './wrapper-script stop' did nothing :/
Should I write the pid inside ruby or use a wrapper script to create the pid necessary for monit?
Source: (StackOverflow)
I'm struggling to find a monit config for php-fpm that works.
This is what I've tried:
### Monitoring php-fpm: the parent process.
check process php-fpm with pidfile /var/run/php-fpm/php-fpm.pid
group phpcgi # phpcgi group
start program = "/etc/init.d/php-fpm start"
stop program = "/etc/init.d/php-fpm stop"
## Test the UNIX socket. Restart if down.
if failed unixsocket /var/run/php-fpm.sock then restart
## If the restarts attempts fail then alert.
if 3 restarts within 5 cycles then timeout
But it fails because there is no php-fpm.sock (Centos 6)
Source: (StackOverflow)
I have written a module in Python and want it to run continuously once started and need to stop it when I need to update other modules. I will likely be using monit to restart it, if module has crashed or is otherwise not running.
I was going through different techniques like Daemon, Upstart and many others.
Which is the best way to go so that I use that approach through out my all new modules to keep running them forever?
Source: (StackOverflow)
We have a custom setup which has several deamons (web apps + background tasks) running. I am looking at using a service which helps us to monitor those deamons and restart them if their resource consumption exceeds over a level.
I will appreciate any insight on when one is better over the other. As I understand monit spins up a new process while supervisord starts a sub process. What is the pros and cons of this approach ?
I will also be using upstart to monitor monit or supervisord itself. The webapp deployment will be done using capistrano.
Thanks
Source: (StackOverflow)
I have a web-service application that exposes lot of web-methods ( internally calling internal APIs or external web-services). I would like to have a tool to monitor this whole application running under IIS. To be clear I just don't want to inspect the requests that are failing, I also would like to see things like how long different calls are taking . I guess it has to be something like SQL Profiler tool
where you can look at all types of queries ( those that run successfully and those that fail too) and then apply all sorts of filter in focusing on the areas that interests you more.
Is there anything built in IIS that could be used for this purpose?
Source: (StackOverflow)
I've been using monit for a little while, but I want to alarm if a file exists. This is the opposite use case from the main documentation.
Here's the doc says:
IF [DOES] NOT EXIST [[<X>] <Y> CYCLES] THEN action [ELSE IF SUCCEEDED [[<X>] <Y> CYCLES] THEN action]
action is a choice of "ALERT", "RESTART", "START", "STOP", "EXEC" or "UNMONITOR".
This gives me the recipe for "freak out if file is missing". But I want to "freak out if the file's there". And the choice of actions implies there's no "do nothing" action. I could shell out to a no-op, but that's really silly for the standard case of "do nothing".
I guessed some basic cases:
IF EXISTS THEN alarm
IF EXIST THEN ALARM
So, is there a standard way to do IF IT DOES EXIST
?
Source: (StackOverflow)
I'm trying to set up Monit for Sidekiq. Here's what I have so far for my config file:
check process sidekiq_site
with pidfile /var/www/site/tmp/pids/sidekiq.pid
start program = "bundle exec sidekiq -C /var/www/site/config/sidekiq.yml -P /var/www/site/tmp/pids/sidekiq.pid" with timeout 90 seconds
if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory?
group site_sidekiq
The problem is I'm getting a message when I run monit reload that the program "bundle" does not exist.
Does anyone have a solution for this?
Source: (StackOverflow)
I'm trying to install monit on linux. I ran the following commands :
wget http://mmonit.com/monit/dist/monit-5.5.tar.gz
tar zxvf monit-5.5.tar.gz
cd monit-5.5
./configure
and when i try :
make && make install
I get :
make: *** No targets specified and no makefile found. Stop.
monit-5.5 directory contains the following :
$ ls
CHANGES Makefile.in bootstrap configure doc monitrc
COPYING README config configure.ac libmonit src
Makefile.am aclocal.m4 config.log contrib monit.1
don't know what's the problem. thank you for your help.
[ec2-user@...~]$ sudo tar zxvf monit-5.5.tar.gz.1 monit-5.5/
monit-5.5/src/
monit-5.5/src/http/
monit-5.5/src/http/base64.h
monit-5.5/src/http/processor.h
monit-5.5/src/http/base64.c
monit-5.5/src/http/cervlet.c
monit-5.5/src/http/cervlet.h
monit-5.5/src/http/engine.h
monit-5.5/src/http/engine.c
monit-5.5/src/http/processor.c
monit-5.5/src/http/httpstatus.h
monit-5.5/src/p.y
monit-5.5/src/collector.c
monit-5.5/src/util.h
monit-5.5/src/ssl.c
monit-5.5/src/status.c
monit-5.5/src/monit.h
monit-5.5/src/log.c
monit-5.5/src/net.c
monit-5.5/src/y.tab.c
monit-5.5/src/file.h
monit-5.5/src/socket.h
monit-5.5/src/md5_crypt.c
monit-5.5/src/event.c
monit-5.5/src/md5.c
monit-5.5/src/daemonize.c
monit-5.5/src/signal.c
monit-5.5/src/process.h
monit-5.5/src/sha1.c
monit-5.5/src/lex.yy.c
monit-5.5/src/md5_crypt.h
monit-5.5/src/socket.c
monit-5.5/src/control.c
monit-5.5/src/config.h.in
monit-5.5/src/net.h
monit-5.5/src/env.c
monit-5.5/src/util.c
monit-5.5/src/alert.c
monit-5.5/src/l.l
monit-5.5/src/state.c
monit-5.5/src/alert.h
monit-5.5/src/md5.h
monit-5.5/src/http.c
monit-5.5/src/validate.c
monit-5.5/src/process.c
monit-5.5/src/gc.c
monit-5.5/src/device/
monit-5.5/src/device/device_sysdep.h
monit-5.5/src/device/sysdep_LINUX.c
monit-5.5/src/device/sysdep_NETBSD.c
monit-5.5/src/device/device.h
monit-5.5/src/device/sysdep_DARWIN.c
monit-5.5/src/device/sysdep_OPENBSD.c
monit-5.5/src/device/sysdep_UNKNOWN.c
monit-5.5/src/device/sysdep_SOLARIS.c
monit-5.5/src/device/device_common.c
monit-5.5/src/device/sysdep_AIX.c
monit-5.5/src/device/sysdep_FREEBSD.c
monit-5.5/src/device/sysdep_HPUX.c
monit-5.5/src/tokens.h
monit-5.5/src/state.h
monit-5.5/src/file.c
monit-5.5/src/spawn.c
monit-5.5/src/protocols/
monit-5.5/src/protocols/rsync.c
monit-5.5/src/protocols/pgsql.c
monit-5.5/src/protocols/mysql.c
monit-5.5/src/protocols/ftp.c
monit-5.5/src/protocols/protocol.c
monit-5.5/src/protocols/apache_status.c
monit-5.5/src/protocols/lmtp.c
monit-5.5/src/protocols/dns.c
monit-5.5/src/protocols/ntp3.c
monit-5.5/src/protocols/sip.c
monit-5.5/src/protocols/nntp.c
monit-5.5/src/protocols/tns.c
monit-5.5/src/protocols/ldap2.c
monit-5.5/src/protocols/smtp.c
monit-5.5/src/protocols/ldap3.c
monit-5.5/src/protocols/radius.c
monit-5.5/src/protocols/http.c
monit-5.5/src/protocols/dwp.c
monit-5.5/src/protocols/imap.c
monit-5.5/src/protocols/default.c
monit-5.5/src/protocols/gps.c
monit-5.5/src/protocols/protocol.h
monit-5.5/src/protocols/pop.c
monit-5.5/src/protocols/generic.c
monit-5.5/src/protocols/ssh.c
monit-5.5/src/protocols/memcache.c
monit-5.5/src/protocols/clamav.c
monit-5.5/src/protocols/postfix_policy.c
monit-5.5/src/protocols/rdate.c
monit-5.5/src/event.h
monit-5.5/src/xml.c
monit-5.5/src/ssl.h
monit-5.5/src/sha1.h
monit-5.5/src/process/
monit-5.5/src/process/sysdep_LINUX.c
monit-5.5/src/process/sysdep_NETBSD.c
monit-5.5/src/process/sysdep_DARWIN.c
monit-5.5/src/process/sysdep_OPENBSD.c
monit-5.5/src/process/sysdep_UNKNOWN.c
monit-5.5/src/process/process_sysdep.h
monit-5.5/src/process/process_common.c
monit-5.5/src/process/sysdep_SOLARIS.c
monit-5.5/src/process/sysdep_AIX.c
monit-5.5/src/process/sysdep_FREEBSD.c
monit-5.5/src/process/sysdep_HPUX.c
monit-5.5/src/sendmail.c
monit-5.5/src/monit.c
monit-5.5/monitrc
monit-5.5/CHANGES
monit-5.5/monit.1
monit-5.5/configure.ac
monit-5.5/configure
monit-5.5/aclocal.m4
monit-5.5/Makefile.in
monit-5.5/bootstrap
monit-5.5/libmonit/
monit-5.5/libmonit/src/
monit-5.5/libmonit/src/thread/
monit-5.5/libmonit/src/thread/Thread.h
monit-5.5/libmonit/src/thread/Thread.c
monit-5.5/libmonit/src/system/
monit-5.5/libmonit/src/system/Time.h
monit-5.5/libmonit/src/system/Net.h
monit-5.5/libmonit/src/system/Mem.c
monit-5.5/libmonit/src/system/Mem.h
monit-5.5/libmonit/src/system/Net.c
monit-5.5/libmonit/src/system/System.h
monit-5.5/libmonit/src/system/Command.h
monit-5.5/libmonit/src/system/Time.c
monit-5.5/libmonit/src/system/System.c
monit-5.5/libmonit/src/system/Process.h
monit-5.5/libmonit/src/system/Command.c
monit-5.5/libmonit/src/io/
monit-5.5/libmonit/src/io/File.h
monit-5.5/libmonit/src/io/Dir.h
monit-5.5/libmonit/src/io/InputStream.h
monit-5.5/libmonit/src/io/InputStream.c
monit-5.5/libmonit/src/io/OutputStream.h
monit-5.5/libmonit/src/io/OutputStream.c
monit-5.5/libmonit/src/io/File.c
monit-5.5/libmonit/src/io/Dir.c
monit-5.5/libmonit/src/util/
monit-5.5/libmonit/src/util/Str.h
monit-5.5/libmonit/src/util/Str.c
monit-5.5/libmonit/src/util/StringBuffer.h
monit-5.5/libmonit/src/util/StringBuffer.c
monit-5.5/libmonit/src/util/List.h
monit-5.5/libmonit/src/util/List.c
monit-5.5/libmonit/src/xconfig.h.in
monit-5.5/libmonit/src/Bootstrap.h
monit-5.5/libmonit/src/Bootstrap.c
monit-5.5/libmonit/src/exceptions/
monit-5.5/libmonit/src/exceptions/MemoryException.h
monit-5.5/libmonit/src/exceptions/AssertException.h
monit-5.5/libmonit/src/exceptions/Exception.h
monit-5.5/libmonit/src/exceptions/NumberFormatException.h
monit-5.5/libmonit/src/exceptions/IOException.h
monit-5.5/libmonit/src/exceptions/assert.c
monit-5.5/libmonit/src/exceptions/Exception.c
monit-5.5/libmonit/src/exceptions/assert.h
monit-5.5/libmonit/src/Config.h
monit-5.5/libmonit/libtool
monit-5.5/libmonit/Makefile
monit-5.5/libmonit/configure.ac
monit-5.5/libmonit/test/
monit-5.5/libmonit/test/OutputStreamTest.c
monit-5.5/libmonit/test/Makefile
monit-5.5/libmonit/test/FileTest.c
monit-5.5/libmonit/test/StrTest.c
monit-5.5/libmonit/test/TimeTest.c
monit-5.5/libmonit/test/CommandTest.c
monit-5.5/libmonit/test/Makefile.in
monit-5.5/libmonit/test/ListTest.c
monit-5.5/libmonit/test/DirTest.c
monit-5.5/libmonit/test/NetTest.c
monit-5.5/libmonit/test/test.sh
monit-5.5/libmonit/test/StringBufferTest.c
monit-5.5/libmonit/test/ExceptionTest.c
monit-5.5/libmonit/test/Makefile.am
monit-5.5/libmonit/test/SystemTest.c
monit-5.5/libmonit/test/InputStreamTest.c
monit-5.5/libmonit/test/data/
monit-5.5/libmonit/test/data/stream.data
monit-5.5/libmonit/configure
monit-5.5/libmonit/aclocal.m4
monit-5.5/libmonit/Makefile.in
monit-5.5/libmonit/bootstrap
monit-5.5/libmonit/config/
monit-5.5/libmonit/config/config.guess
monit-5.5/libmonit/config/missing
monit-5.5/libmonit/config/ltmain.sh
monit-5.5/libmonit/config/install-sh
monit-5.5/libmonit/config/config.sub
monit-5.5/libmonit/COPYING
monit-5.5/libmonit/README
monit-5.5/libmonit/Makefile.am
monit-5.5/libmonit/m4/
monit-5.5/libmonit/m4/libtool.m4
monit-5.5/libmonit/m4/lt~obsolete.m4
monit-5.5/libmonit/m4/ltsugar.m4
monit-5.5/libmonit/m4/ltoptions.m4
monit-5.5/libmonit/m4/ltversion.m4
monit-5.5/contrib/
monit-5.5/contrib/monitrc-gentoo
monit-5.5/contrib/rc.monit
monit-5.5/contrib/packages/
monit-5.5/contrib/packages/freebsd/
monit-5.5/contrib/packages/freebsd/pkg-message
monit-5.5/contrib/packages/freebsd/distinfo
monit-5.5/contrib/packages/freebsd/Makefile
monit-5.5/contrib/packages/freebsd/files/
monit-5.5/contrib/packages/freebsd/files/monit.sh
monit-5.5/contrib/packages/freebsd/pkg-descr
monit-5.5/contrib/packages/freebsd/README.porter
monit-5.5/contrib/packages/redhat/
monit-5.5/contrib/packages/redhat/monit.spec
monit-5.5/contrib/packages/solaris/
monit-5.5/contrib/packages/solaris/README.solaris
monit-5.5/contrib/packages/solaris/init.monit
monit-5.5/contrib/packages/solaris/makesolpkg.sh
monit-5.5/contrib/monit.upstart.in
monit-5.5/contrib/monit.service.in
monit-5.5/contrib/monit.service
monit-5.5/contrib/monit.upstart
monit-5.5/config/
monit-5.5/config/config.guess
monit-5.5/config/missing
monit-5.5/config/ltmain.sh
monit-5.5/config/install-sh
monit-5.5/config/config.sub
monit-5.5/COPYING
monit-5.5/README
monit-5.5/doc/
monit-5.5/doc/monit.pod
monit-5.5/doc/PLATFORMS
monit-5.5/Makefile.am
[ec2-user@domU-12-31-39-03-28-A1 ~]$ ls
crawller monit-5.5 node-v0.8.14 tmp
m_2.2.0.tgz monit-5.5.tar.gz node-v0.8.14.tar.gz
mongodb-linux-x86_64-2.2.0 monit-5.5.tar.gz.1 nodejs
[ec2-user@domU-12-31-39-03-28-A1 ~]$ cd monit-5.5
[ec2-user@domU-12-31-39-03-28-A1 monit-5.5]$ sudo ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... none
checking whether make sets $(MAKE)... (cached) yes
checking for bison... bison -y
checking for flex... /usr/bin/flex
checking for pod2man... /usr/bin/pod2man
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for socket in -lsocket... no
checking for socket in -linet... no
checking for inet_addr in -lnsl... yes
checking for inet_aton in -lresolv... yes
checking for crypt in -lc... no
checking for crypt in -lcrypt... yes
checking for pthread_create in -lpthread... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking whether stat file-mode macros are broken... no
checking whether time.h and sys/time.h may both be included... yes
checking alloca.h usability... yes
checking alloca.h presence... yes
checking for alloca.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking asm/page.h usability... no
checking asm/page.h presence... no
checking for asm/page.h... no
checking asm/param.h usability... yes
checking asm/param.h presence... yes
checking for asm/param.h... yes
checking cf.h usability... no
checking cf.h presence... no
checking for cf.h... no
checking crt_externs.h usability... no
checking crt_externs.h presence... no
checking for crt_externs.h... no
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking crypt.h usability... yes
checking crypt.h presence... yes
checking for crypt.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking glob.h usability... yes
checking glob.h presence... yes
checking for glob.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking kvm.h usability... no
checking kvm.h presence... no
checking for kvm.h... no
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking kstat.h usability... no
checking kstat.h presence... no
checking for kstat.h... no
checking sys/protosw.h usability... no
checking sys/protosw.h presence... no
checking for sys/protosw.h... no
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking loadavg.h usability... no
checking loadavg.h presence... no
checking for loadavg.h... no
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking mach/host_info.h usability... no
checking mach/host_info.h presence... no
checking for mach/host_info.h... no
checking mach/mach.h usability... no
checking mach/mach.h presence... no
checking for mach/mach.h... no
checking mach/mach_host.h usability... no
checking mach/mach_host.h presence... no
checking for mach/mach_host.h... no
checking for memory.h... (cached) yes
checking mntent.h usability... yes
checking mntent.h presence... yes
checking for mntent.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking pam/pam_appl.h usability... no
checking pam/pam_appl.h presence... no
checking for pam/pam_appl.h... no
checking security/pam_appl.h usability... no
checking security/pam_appl.h presence... no
checking for security/pam_appl.h... no
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking procfs.h usability... no
checking procfs.h presence... no
checking for procfs.h... no
checking sys/procfs.h usability... yes
checking sys/procfs.h presence... yes
checking for sys/procfs.h... yes
checking procinfo.h usability... no
checking procinfo.h presence... no
checking for procinfo.h... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking setjmp.h usability... yes
checking setjmp.h presence... yes
checking for setjmp.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking stropts.h usability... no
checking stropts.h presence... no
checking for stropts.h... no
checking sys/cfgodm.h usability... no
checking sys/cfgodm.h presence... no
checking for sys/cfgodm.h... no
checking sys/cfgdb.h usability... no
checking sys/cfgdb.h presence... no
checking for sys/cfgdb.h... no
checking sys/dk.h usability... no
checking sys/dk.h presence... no
checking for sys/dk.h... no
checking sys/dkstat.h usability... no
checking sys/dkstat.h presence... no
checking for sys/dkstat.h... no
checking sys/filio.h usability... no
checking sys/filio.h presence... no
checking for sys/filio.h... no
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/loadavg.h usability... no
checking sys/loadavg.h presence... no
checking for sys/loadavg.h... no
checking sys/lock.h usability... no
checking sys/lock.h presence... no
checking for sys/lock.h... no
checking sys/mnttab.h usability... no
checking sys/mnttab.h presence... no
checking for sys/mnttab.h... no
checking sys/mutex.h usability... no
checking sys/mutex.h presence... no
checking for sys/mutex.h... no
checking sys/nlist.h usability... no
checking sys/nlist.h presence... no
checking for sys/nlist.h... no
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/pstat.h usability... no
checking sys/pstat.h presence... no
checking for sys/pstat.h... no
checking sys/queue.h usability... yes
checking sys/queue.h presence... yes
checking for sys/queue.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/statfs.h usability... yes
checking sys/statfs.h presence... yes
checking for sys/statfs.h... yes
checking sys/statvfs.h usability... yes
checking sys/statvfs.h presence... yes
checking for sys/statvfs.h... yes
checking sys/sysinfo.h usability... yes
checking sys/sysinfo.h presence... yes
checking for sys/sysinfo.h... yes
checking sys/systemcfg.h usability... no
checking sys/systemcfg.h presence... no
checking for sys/systemcfg.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/tree.h usability... no
checking sys/tree.h presence... no
checking for sys/tree.h... no
checking for sys/types.h... (cached) yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking sys/vmmeter.h usability... no
checking sys/vmmeter.h presence... no
checking for sys/vmmeter.h... no
checking sys/vfs.h usability... yes
checking sys/vfs.h presence... yes
checking for sys/vfs.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking uvm/uvm.h usability... no
checking uvm/uvm.h presence... no
checking for uvm/uvm.h... no
checking uvm/uvm_extern.h usability... no
checking uvm/uvm_extern.h presence... no
checking for uvm/uvm_extern.h... no
checking vm/vm.h usability... no
checking vm/vm.h presence... no
checking for vm/vm.h... no
checking for libperfstat.h... no
checking for netinet/ip.h... yes
checking for net/if.h... yes
checking for netinet/ip_icmp.h... yes
checking for sys/sysctl.h... yes
checking for sys/mount.h... yes
checking for sys/proc.h... no
checking for sys/swap.h... yes
checking for sys/ucred.h... no
checking for sys/user.h... yes
checking for machine/vmparam.h... no
checking for vm/pmap.h... no
checking for machine/pmap.h... no
checking for vm/vm_map.h... no
checking for vm/vm_object.h... no
checking for sys/resourcevar.h... no
checking for uvm/uvm_map.h... no
checking for uvm/uvm_pmap.h... no
checking for uvm/uvm_object.h... no
checking for mode_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for pid_t... (cached) yes
checking return type of signal handlers... void
checking whether struct tm is in sys/time.h or time.h... time.h
checking for struct tm.tm_gmtoff... no
checking for error_at_line... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether lstat correctly handles trailing slash... yes
checking whether stat accepts an empty string... no
checking for strftime... yes
checking for statfs... yes
checking for statvfs... yes
checking for setlocale... yes
checking for getaddrinfo... yes
checking for syslog... yes
checking for vsyslog... yes
checking for backtrace... yes
checking for getloadavg... yes
checking for SOL_IP... yes
checking for va_copy... yes
checking for an ANSI C-conforming const... yes
checking whether byte ordering is bigendian... no
checking pid file location... /var/run
checking for large files support... enabled
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for PAM support... enabled
checking for pam_start in -lpam... no
configure: error: PAM enabled but headers or library not found, install the PAM development support or run configure --without-pam
[ec2-user@... monit-5.5]$ make && make install
make: *** No targets specified and no makefile found. Stop.
Source: (StackOverflow)
I have a spring-boot application which is monitored by monit.
Monit just check the /health endpoint spring is exposing.
Basically, monit registered the following checks :
check host hopsearch_connection with address 127.0.0.1
if failed url http://127.0.0.1:8089/health with timeout 15 seconds then alert
check host hopsearch_health with address 127.0.0.1
if failed url http://127.0.0.1:8089/health
and content != 'DOWN'
with timeout 60 seconds
then alert
and the web application return something like that :
{"status":"UP","jestHealth":{"status":"UP","lastQuerySuccess":true},"diskSpace":{"status":"UP","free":14439550976,"threshold":10485760},"rabbit":{"status":"UP","version":"3.3.2"},"redis":{"status":"UP","version":"3.0.0"},"mongo":{"status":"UP","version":"2.6.1"}}
In this spring application, I have a general @ExceptionHandler to log all unexpected errors and to display an error page :
@ExceptionHandler(Exception.class)
@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR)
public String handleDefaultError(Exception ex, HttpServletRequest httpRequest) {
logException(httpRequest, ex);
return "error";
}
And this @ExceptionHandler logs every call from monit :
<11>May 1 13:20:39 IP 13:20:39.339 t=http-nio-8089-exec-3 l=ERROR c=c.h.s.w.c.ErrorManager m=Error 500
----------------------------------------------------------------
Request Path=http://127.0.0.1:8089/health
Method=GET
----------------------------------------------------------------
Header :
----------------------------------------------------------------
host = 127.0.0.1:8089
accept = */*
connection = close
user-agent = monit/5.4
----------------------------------------------------------------
<11>May 1 13:20:39 IP 13:20:39.340 t=http-nio-8089- exec-3 l=ERROR c=c.h.s.w.c.ErrorManager m=Unexpected error : java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[na:1.8.0_25]
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) ~[na:1.8.0_25]
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93) ~[na:1.8.0_25]
at sun.nio.ch.IOUtil.write(IOUtil.java:65) ~[na:1.8.0_25]
From monit perspective, everything is fine and the check works.
From my perspective, the application works. But I have a lot of errors dumped in the log.
I don't succeed to reproduce on my workstation with curl. This exception only happens on the server with monit.
Is it possible to ignore an error based on a specific user agent in an ExceptionHandler ? (and how ?)
It wouldn't be the best solution but I don't see any other way.
Any thoughts about that ?
Source: (StackOverflow)
I am looking out to use monit tool for my Rails app.As this is my first attempting in using any monitoring tool can anybody guide me or point me to some references on how can I set up and use monit tool with the default Rails Webrick server (local development environment) ? I found the following references but all of them showcases monit config for a Apache, Nginx etc.
Environment:
- Ubuntu 12.04
- ruby 1.9.3dev (2011-09-23 revision 33323) [i686-linux]
- Rails 3.2.6
- Monit version 5.3.2
Thanks,
Jignesh
Source: (StackOverflow)
Monit seems to be working, but when I go to the web interface at port :2812 I get
-->:/var/log$ sudo monit -t
Control file syntax OK
-->:/var/log$ sudo monit status
The Monit daemon 5.2.5 uptime: 11m
System 'system_mydomain.net'
status running
monitoring status monitored
load average [0.00] [0.01] [0.05]
cpu 0.0%us 0.0%sy 0.0%wa
memory usage 645520 kB [63.4%]
swap usage 213128 kB [10.1%]
data collected Wed Feb 15 06:27:26 2012
Any ideas what would cause this?
Source: (StackOverflow)
Summary
How can I combine multiple checks in Monit? I want to check against process activity and file content/timestamp.
Long and boring explanation
I'm working on a Monit daemon for keeping my Bukkit Minecraft server up. It does several checks. At the moment I have this code:
#!monit
check process bukkit pidfile /var/run/bukkit.pid # check if the java process is running
start program = "/sbin/start bukkit" # start with Upstart
stop program = "/sbin/stop bukkit" # stop with Upstart
if failed # send a noop request to check if the server responses
host cubixcraft.de port 20059 protocol http
and request "/api/call?method=runConsoleCommand&args=%5B%22noop%22%5D&key=d9c7f3f6be0c92c1b2725f0e5a3352514cee0885c3bf7e0189a76bbaf2f4d7a7"
with checksum e006695c8da58e03f17a305afd1a1a32
timeout 20 seconds for 2 cycles
then restart # restart if it fails
It works... but it's slow. I have to wait 20 seconds until the server gets terminated if something went wrong. But I need that timeout because the server does some reloads (to refresh the configuration, clean the memory, etc.) from time to time which produce little lags. Without the timeout 20 seconds for 2 cycles
the server would be terminated immedeately if it reloads.
Okay, it's no problem for me to wait 20 seconds until the server gets restarted if something really went wrong. But most of the time (when something goes wrong) all security mechanisms on the server quit working.
And because of that I need to find a way to restart the server immedeatly if it doesn't response, but give it some time, when it reloads.
I have this approach: The server writes something to a logfile, when any command (including reloads and API calls which I use to check the server status) is issued. So the timestamp of the logfile is the timestamp of the last command. During a reload nothing gets written to the file. So I can detect a reload with a simple timestamp check and only if the server currently reloads I give it its 20 seconds.
Source: (StackOverflow)
I have a simple script that I'm trying to get Monit to monitor. After some digging around I found this little nugget: start program = "su - myuser -c '/home/user/myscript.rb start' "
which I believe should work but looking at the log files it says:
[PDT Oct 30 02:47:17] info : 'simple_script' start: su
[PDT Oct 30 02:47:17] error : Error: Could not execute su
Likewise earlier attempts only seem to read the part preceding a space so:
start program = "/home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby /home/user/simple_script_daemon.rb stop"
results in…
[PDT Oct 30 03:09:49] info : 'simple_script' start: /home/user/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
Which doesn't fail like the first example but still seems to only execute the part preceding the space.
This is my full statement:
check process simple_script
with pidfile /home/user/simple_script.rb.pid
start program = "su - user -c '/home/user/simple_script_daemon.rb start' "
stop program = "su - user -c '/home/user/simple_script_daemon.rb stop' "
group simple_script
If you've got an idea what might be going on I'd love to hear from you!
Source: (StackOverflow)