<HTML>
<div><font style="font-family:tahoma;font-size:10pt;">
<div>Thanks for the reply Guy.<br />
 </div>
<div>I installed nagios from the "contrib" repo. as per the blog 
here...and all looks like it's working fine. This is the most recent version 
in the repo's. I guess I could compile it from source, but would like to be 
sure that's the issue before I go down this path.</div>
<div><a 
href="http://blogs.sun.com/baiken/entry/nagios_installation_guide_for_opensolaris">
http://blogs.sun.com/baiken/entry/nagios_installation_guide_for_opensolaris</a>
</div>
<div> </div>
<div><span class="Apple-style-span" style="font-family: monospace; 
font-size: 12px; color: rgb(24, 24, 24); line-height: 18px; ">
<ol>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 221); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">And this additional 
information....</div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">
nas@nas:/usr/nagios/libexec/eventhandler# ldd /usr/nagios/bin/nagios</div>
    </li>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 255); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">      
  libm.so.2 =>     /lib/libm.so.2</div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">      
  libpthread.so.1 =>      
 /lib/libpthread.so.1</div>
    </li>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 255); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">      
  libdl.so.1 =>    /lib/libdl.so.1</div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">      
  libc.so.1 =>     /lib/libc.so.1</div>
    </li>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 255); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; "> </div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">Installed Nagios from 
contrib. repo.</div>
    </li>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 255); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">Summary:    
             Host/service/network 
monitoring program</div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">  Size:   
               12.19 MB</div>
    </li>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 255); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">  Category: 
             None</div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">  Installed 
Version:     3.0.6,5.11-0.111</div>
    </li>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 255); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">  Latest 
Version:        3.0.6,5.11-0.111</div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">  Packaging 
Date:        Tue Oct 27 16:14:19 2009</div>
    </li>
    <li class="li1" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(255, 255, 255); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de1" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">  FMRI:   
              
 pkg:/nagios@3.0.6,5.11-0.111:20091027T161419Z</div>
    </li>
    <li class="li2" style="background-image: initial; background-attachment: 
initial; background-origin: initial; background-clip: initial; 
background-color: rgb(248, 248, 248); background-position: initial initial; 
background-repeat: initial initial; ">
    <div class="de2" style="font: normal normal normal 1em/1.2em monospace; 
margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; 
padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 
0px; background-image: none; background-attachment: initial; 
background-origin: initial; background-clip: initial; background-color: 
initial; vertical-align: top; line-height: 18px; background-position: 
initial initial; background-repeat: initial initial; ">  Repository: 
           contrib</div>
    </li>
</ol>
</span></div>
<div>re: trace...Solaris does have dtrace...and it's supposed to be pretty 
good, but I'd need to read up a heap to understand how to use it.</div>
<div> </div>
<div>Any more ideas folks?</div>
</font></div>
<blockquote style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; 
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> -----Original 
Message-----<br />
From: Guy Waugh <guidosh@gmail.com><br />
To: Nagios Users List <nagios-users@lists.sourceforge.net><br />
Date: Wed, 19 May 2010 11:07:52 +0100<br />
Subject: Re: [Nagios-users] Anyone? : SIGSEGV when trying to use 
eventhandler<br />
<br />
I'm definitely no expert but...<br />
* What does it say when you 'ldd' the nagios binary? Are all the libraries 
the binary is linked against able to be found? Are those libraries 
up-to-date?<br />
* Where did you get nagios from? Did you compile it or is it pre-built? If 
pre-built, are there any updates?<br />
* I don't know Solaris well enough to know how to trace your running nagios 
with a very simple configuration, but that might be the next step. 
strace?<br />
<br />
<div class="gmail_quote">On 19 May 2010 10:49, nagios <span dir="ltr"><<a 
href="mailto:nagios@chadmail.com">nagios@chadmail.com</a>></span> 
wrote:<br />
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><font style="font-family: tahoma; font-size: 10pt;">
<div>Anybody?</div>
<div> </div>
<div>If you need extra information, just let me know what you need to see  
and I'll upload it.</div>
<div> </div>
<div>Thanks.</div>
</font></div>
<blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; 
padding-left: 5px; margin-left: 5px; margin-right: 0px;"> -----Original  
Message-----<br />
From: "nagios" <<a target="_blank" 
href="mailto:nagios@chadmail.com">nagios@chadmail.com</a>><br />
To: <a target="_blank" href="mailto:nagios-users@lists.sourceforge.net">
nagios-users@lists.sourceforge.net</a><br />
Date: Wed, 19 May 2010 01:42:15 +1000<br />
Subject: [Nagios-users] SIGSEGV when trying to use eventhandler<br />
<br />
<div><font style="font-family: tahoma; font-size: 10pt;">
<div>Hi guys,</div>
<div>    I am new to nagios but so far it's working well for me   
and is monitoring a number of real and virtual hosts. Nagios 3.0.6 is   
installed on an OpenSolaris 2009.06 host and monitoring routers other   
devices and VM's in VirtualBox.</div>
<div> </div>
<div>My issue is when I try to add an event handler, I get a SIGSEGV and   
nagios restarts.</div>
<div> </div>
<div> </div>
<div>I have posted the details of the code I am using and the error   
here...<a target="_blank" href="http://pastebin.com/vBb7xTND">
http://pastebin.com/vBb7xTND</a> and also below (but it reads better @   
pastebin).</div>
<div> </div>
<div>I have tried several different scripts and code combinations (even   
empty scripts and commands like ls) and all give the same error.</div>
<div> </div>
<div>Can anyone help me work out why it's happening?</div>
<div> </div>
<div>Thanks.</div>
<div> </div>
<div>hosts.cfg<br />
<snip><br />
define host{<br />
use             windows-server  ; Inherit default values from a template<br 
/>
host_name       Server6         ; The name we're giving to this host<br />
max_check_attempts              4<br />
event_handler   vboxmanage-restart ; Restart the vm<br />
alias           Server 6 - Win2008 Server       ; A longer name associated   
with the host<br />
address         192.168.0.6     ; IP address of the host<br />
}<br />
<snip><br />
<br />
commands.cfg - note I have tried various scripts here incl. ones from the   
nagios guides/books and all give the same error.<br />
<snip><br />
# 'vboxmanage_restart' command definition<br />
define command{<br />
command_name vboxmanage-restart<br />
#        command_line ls<br />
command_line sudo -u nas $USER1$/eventhandler/event_vboxmanage_restart -S   
$SERVICESTATE$ -T $SERVICESTATETYPE$ -A $SERVICEATTEMPT$ -H Server6<br />
}<br />
<snip><br />
<br />
nagios.log<br />
[1274193005] HOST ALERT: Server6;DOWN;SOFT;1;PING CRITICAL - Packet loss =   
100%<br />
[1274193005] Caught SIGSEGV, shutting down...<br />
[1274193005] Nagios 3.0.6 starting... (PID=5231)<br />
[1274193005] Local time is Wed May 19 00:30:05 EST 2010<br />
[1274193005] LOG VERSION: 2.0<br />
[1274193005] Finished daemonizing... (New PID=5232)<br />
<br />
the scripts... (yes I know it should not be 777's but just to show it's not  
 a permissions thing)<br />
-rwxrwxrwx 1 nagios nagios 1580 2010-05-18 00:52 event_vboxmanage_restart<br 
/>
-rwxrwxrwx 1 nagios nagios 3815 2010-05-18 23:07 filename.out<br />
-rwxrwxrwx 1 nagios nagios 2211 2010-05-19 00:23 restart-httpd<br />
nas@nas:/usr/nagios/libexec/eventhandler# <br />
<br />
The script work fine from the user nagios using sudo (added nagios to   
/etc/sudoers)<br />
nas@nas:…sr/nagios/libexec/eventhandler$ whoami                       
                                                                      <br />
nagios<br />
nas@nas:…sr/nagios/libexec/eventhandler$ sudo -u nas   
./event_vboxmanage_restart -S CRITICAL -T HARD -A 1 -H Server6               
          <br />
CRITICAL(C) 2005-2010 Sun Microsystems, Inc.<br />
<br />
The event_vboxmanage_restart script...no that this is likely to be at fault  
 (I do not think anyway as I get the error with other very simple scripts   
too).<br />
#!/usr/bin/perl<br />
<br />
use Getopt::Long;<br />
use Net::Telnet ();<br />
use Switch;<br />
my ($state,$type,$attempt,$cmd,$hostname);<br />
open(MYOUTFILE,   
">>/usr/nagios/libexec/eventhandler/filename.out");<br />
<br />
&processargs;<br />
print "$state"; <br />
switch ($state) {<br />
case "OK"          { &state_OK }<br />
case "WARNING"     { &state_WARNING }<br />
case "UNKNOWN"     { &state_UNKNOWN }<br />
case "CRITICAL"    { &state_CRITICAL }<br />
else               { print "unrecognised state>$state" }<br />
}<br />
print MYOUTFILE">$state<";<br />
print MYOUTFILE">$hostname<";<br />
close(MYOUTFILE);<br />
exit 0;<br />
<br />
sub processargs {<br />
<br />
GetOptions (<br />
"S|state=s" => \$state,<br />
"T|type=s" => \$type,<br />
"A|attempt=i" => \$attempt,<br />
"H|hostname=s" => \$hostname,<br />
"C|command=s" => \$cmd,<br />
);<br />
}<br />
<br />
### FUNC: print $state<br />
sub print_state {<br />
}<br />
### FUNC: print $state<br />
sub state_OK {<br />
}<br />
### FUNC: print $state<br />
sub state_WARNING {<br />
}<br />
### FUNC: print $state<br />
sub state_UNKNOWN {<br />
}<br />
### FUNC: print $state<br />
sub state_CRITICAL {<br />
if ("$type" eq "HARD" or ("$type" eq   
"SOFT" and $attempt == 3)) {@result=`VBoxManage controlvm   
$hostname acpipowerbutton`; foreach (@result) {<br />
print MYOUTFILE"$_\n";<br />
};sleep(60);@result=`VBoxManage controlvm $hostname poweroff`;foreach   
(@result) {<br />
print MYOUTFILE"$_\n";<br />
}; @result=`VBoxManage startvm $hostname`; print "$result[1]";<br 
/>
}<br />
else            { }<br />
}<br />
<br />
 As you can see from the below, it all works fine (ie. no SIGSEGV's) if 
  I comment out the eventhandler line from the hosts.cfg file.</div>
<div>[05-19-2010 01:33:50] SERVICE ALERT:   
Server6;Explorer;OK;HARD;1;Explorer.EXE: Running<br />
[05-19-2010 01:32:50] SERVICE ALERT: Server6;Uptime;OK;HARD;1;System Uptime  
 - 0 day(s) 0 hour(s) 9 minute(s)<br />
[05-19-2010 01:32:40] SERVICE ALERT: Server6;C:\ Drive Space;OK;HARD;1;c:\ - 
  total: 39.90 Gb - used: 9.19 Gb (23%) - free 30.71 Gb (77%)<br />
[05-19-2010 01:32:10] SERVICE ALERT: Server6;CPU Load;OK;HARD;1;CPU Load 3%  
 (5 min average)<br />
[05-19-2010 01:25:00] HOST ALERT: Server6;UP;SOFT;4;PING OK - Packet loss =  
 0%, RTA = 0.44 ms<br />
[05-19-2010 01:23:50] SERVICE ALERT:   
Server6;Explorer;CRITICAL;HARD;1;Connection refused<br />
[05-19-2010 01:23:50] HOST ALERT: Server6;DOWN;SOFT;3;PING CRITICAL - Packet 
  loss = 100%<br />
[05-19-2010 01:23:00] SERVICE ALERT: Server6;Uptime;CRITICAL;HARD;1;CRITICAL 
  - Socket timeout after 10 seconds<br />
[05-19-2010 01:22:50] SERVICE ALERT: Server6;C:\ Drive   
Space;CRITICAL;HARD;1;CRITICAL - Socket timeout after 10 seconds<br />
[05-19-2010 01:22:30] HOST ALERT: Server6;DOWN;SOFT;2;PING CRITICAL - Packet 
  loss = 100%<br />
[05-19-2010 01:22:20] SERVICE ALERT: Server6;CPU   
Load;CRITICAL;HARD;1;CRITICAL - Socket timeout after 10 seconds<br />
[05-19-2010 01:21:10] HOST ALERT: Server6;DOWN;SOFT;1;PING CRITICAL - Packet 
  loss = 100%<br />
[05-19-2010 01:21:00] SERVICE ALERT: Server6;Uptime;CRITICAL;SOFT;1;CRITICAL 
  - Socket timeout after 10 seconds<br />
[05-19-2010 01:20:50] SERVICE ALERT: Server6;C:\ Drive   
Space;CRITICAL;SOFT;1;CRITICAL - Socket timeout after 10 seconds<br />
[05-19-2010 01:02:10] SERVICE ALERT: Server6;CPU Load;OK;SOFT;1;CPU Load 0%  
 (5 min average)<br />
[05-19-2010 01:00:50] SERVICE ALERT: Server6;Uptime;OK;SOFT;1;System Uptime  
 - 0 day(s) 0 hour(s) 57 minute(s)<br />
[05-19-2010 01:00:40] SERVICE ALERT: Server6;C:\ Drive Space;OK;SOFT;1;c:\ - 
  total: 39.90 Gb - used: 9.19 Gb (23%) - free 30.71 Gb (77%)<br />
 </div>
</font></div>
</blockquote>  <br />
------------------------------------------------------------------------------<br 
/>
<br />
<br />
_______________________________________________<br />
Nagios-users mailing list<br />
<a href="mailto:Nagios-users@lists.sourceforge.net">
Nagios-users@lists.sourceforge.net</a><br />
<a target="_blank" 
href="https://lists.sourceforge.net/lists/listinfo/nagios-users">
https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br />
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue.<br />
::: Messages without supporting info will risk being sent to /dev/null<br />
</blockquote></div>
<br />
</blockquote>
</HTML>