monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configure and launch monit agent on solaris


From: Pierre-Philipp Braun
Subject: Re: configure and launch monit agent on solaris
Date: Fri, 3 Jun 2016 16:54:41 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

To setup it up on Solaris, I used monit v5.14's monitrc as a sample and used it 
on this 5.5.1 package provided by CSW.  Also old school init script works even 
on Solaris 11.  See below.  Note that pkill monit is a bit too brutal as it may 
kill other processes containing 'monit' in their name.  Improvements are 
welcome.

Install monit agent from CSW repo (https://www.opencsw.org/package/monit/)

Then create a configuration from scratch e.g.,

/opt/csw/bin/amd64/monit -V
cd /etc/opt/csw/
vi monitrc
set mmonit http_or_https://monit:address@hidden:PORT]/collector
set daemon 30
set logfile syslog
set httpd port 2812 and
use address localhost
allow localhost
allow admin:monit

chmod 700 monitrc

Old school init script,

vi /etc/init.d/monit

#!/usr/sbin/sh

case "$1" in
'restart')
        pkill monit
        /opt/csw/bin/amd64/monit
        ;;

'start')
        /opt/csw/bin/amd64/monit
        ;;

'stop')
        pkill monit
        ;;

'status')
        pgrep -lf monit
        ;;

*)
        echo "Usage: $0 { start | stop | restart }"
        exit 1
        ;;
esac

chown root:sys /etc/init.d/monit
chmod 744 /etc/init.d/monit
ln -s ../init.d/monit /etc/rc2.d/S99monit
ln -s ../init.d/monit /etc/rc0.d/K99monit

Hope this helps!

Pierre-Philipp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]