Munin

如何在 SmartOS Global Zone 上執行 munin-node?

  • December 30, 2012

我想munin-node在我的 SmartOS Global Zone 上執行,以遠端監控硬體和軟體狀態。

我試過pkgin in munin-node-1.4.5了,但安裝失敗,因為它無法創建munin使用者帳戶(這是有道理的,因為/etc/passwd它是根 ramdisk 的一部分)。

這樣做的正確方法是什麼?

我能夠通過從原始碼安裝來使其工作。這是我使用的食譜:

pkgin in gmake perl
cpan HTML::Template Log::Log4perl Net::Server Net::Server::Fork
mkdir -p /opt/local/src
cd /opt/local/src
wget http://sourceforge.net/projects/munin/files/stable/2.0.9/munin-2.0.9.tar.gz/download
tar zxvf munin-2.0.9.tar.gz
cd munin-2.0.9
vi Makefile.config
   # change PREFIX to `/opt/local`
   # change CONFDIR to `/opt/local/etc/munin`
   # change LIBDIR to `$(PREFIX)/lib/munin`
   # change STATEDIR to `$(DESTDIR)/var/run`
   # change USER and GROUP to `nobody`
make
make install-common-prime install-node-prime install-plugins-prime
vi /opt/local/etc/munin/munin-node.conf
   # set access controls
munin-node-configure --shell | sh -x
mkdir -p /opt/custom/smf

/opt/custom/smf/munin-node.xml使用以下內容創建:

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<service_bundle type='manifest' name='export'>
 <service name='network/munin-node' type='service' version='0'>
   <create_default_instance enabled='true'/>
   <single_instance/>
   <exec_method name='start' type='method' exec='/opt/local/sbin/munin-node' timeout_seconds='0'>
     <method_context/>
   </exec_method>
   <exec_method name='stop' type='method' exec=':kill' timeout_seconds='0'>
     <method_context/>
   </exec_method>
 </service>
</service_bundle>

引用自:https://serverfault.com/questions/461817