<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.5pt;
font-family:Consolas;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Consolas;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>I have started monitoring the nagios server (local
checks), and all has worked fine until I added a service to check the local
logs. When the 'check_local_logs' service is added, the startup of Nagios
fails after about 10 seconds. I have also run 'strace' but am not sure how to
interpret. <o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Thanks in advance,<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Bret Goodfellow<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Here is the output in /var/log/messages:<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Nagios 2.10 starting...
(PID=6939) Aug 14 08:56:29 colorado nagios: LOG VERSION: 2.0 Aug 14 08:56:29
colorado nagios: Warning: Contact 'oc02497' is not a member of any contact
groups!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Warning: Contact
'oc02571' is not a member of any contact groups!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Warning: Contact
'oc03101' is not a member of any contact groups!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Warning: Contact
'oc03214' is not a member of any contact groups!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Warning: Contact
'oc09687' is not a member of any contact groups!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Warning: Contact group
'oracle-admins-oncall' is not used in any host/service definitions or
host/service escalations!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Warning: Contact group
'web-dev' is not used in any host/service definitions or host/service
escalations!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Warning: Contact group
'web-dev-page' is not used in any host/service definitions or host/service
escalations!<o:p></o:p></p>
<p class=MsoPlainText>Aug 14 08:56:29 colorado nagios: Finished daemonizing...
(New PID=6940) Aug 14 08:56:41 colorado nagios: Caught SIGSEGV, shutting down...<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Here is the command definition:<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText># 'check_local_logs' command definition<o:p></o:p></p>
<p class=MsoPlainText>define command{<o:p></o:p></p>
<p class=MsoPlainText> command_name check_local_logs<o:p></o:p></p>
<p class=MsoPlainText> command_line $USER1$/check_logs.pl -c $ARG1$<o:p></o:p></p>
<p class=MsoPlainText> }<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Here is the service defintion:<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText># ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<o:p></o:p></p>
<p class=MsoPlainText># Service definition: check_local_logs for linux #
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<o:p></o:p></p>
<p class=MsoPlainText># + this is a TEST service which looks for "HELLO
THERE!" in /var/log/messages + #
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<o:p></o:p></p>
<p class=MsoPlainText>define service{<o:p></o:p></p>
<p class=MsoPlainText> use
generic-service ; Name of service template to use<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText> host_name colorado<o:p></o:p></p>
<p class=MsoPlainText> service_description Scan Logs - linux<o:p></o:p></p>
<p class=MsoPlainText> is_volatile 0<o:p></o:p></p>
<p class=MsoPlainText> check_period 24x7<o:p></o:p></p>
<p class=MsoPlainText> max_check_attempts 1<o:p></o:p></p>
<p class=MsoPlainText> normal_check_interval 1<o:p></o:p></p>
<p class=MsoPlainText> retry_check_interval 1<o:p></o:p></p>
<p class=MsoPlainText> contact_groups
linux-admins,linux-admins-page<o:p></o:p></p>
<p class=MsoPlainText> notification_interval 1440<o:p></o:p></p>
<p class=MsoPlainText> notification_period 24x7<o:p></o:p></p>
<p class=MsoPlainText> notification_options c<o:p></o:p></p>
<p class=MsoPlainText> check_command
check_local_logs!/etc/nagios/check_logs_linux.cfg!<o:p></o:p></p>
<p class=MsoPlainText> }<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Here is the host defintion:<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>######################################################################################<o:p></o:p></p>
<p class=MsoPlainText># 'colorado' host definition #<o:p></o:p></p>
<p class=MsoPlainText>######################################################################################<o:p></o:p></p>
<p class=MsoPlainText>define host{<o:p></o:p></p>
<p class=MsoPlainText> use generic-host ;
Name of host template to use<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText> host_name colorado<o:p></o:p></p>
<p class=MsoPlainText> alias colorado<o:p></o:p></p>
<p class=MsoPlainText> address 10.8.64.201<o:p></o:p></p>
<p class=MsoPlainText> check_command check-host-alive<o:p></o:p></p>
<p class=MsoPlainText> contact_groups
linux-admins,linux-admins-page,oracle-admins<o:p></o:p></p>
<p class=MsoPlainText> max_check_attempts 10<o:p></o:p></p>
<p class=MsoPlainText> max_check_attempts 10<o:p></o:p></p>
<p class=MsoPlainText> notification_interval 480<o:p></o:p></p>
<p class=MsoPlainText> notification_period 24x7<o:p></o:p></p>
<p class=MsoPlainText> notification_options d,u,r<o:p></o:p></p>
<p class=MsoPlainText> }<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Here is a copy of /etc/nagios/check_logs_linux.cfg<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText># /etc/nagios/check_logs_linux.cfg<o:p></o:p></p>
<p class=MsoPlainText>$seek_file_template='/var/log/nagios/$log_file.check_log.linux.seek';<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>@log_files = (<o:p></o:p></p>
<p class=MsoPlainText> {'file_name' => '/var/log/messages',<o:p></o:p></p>
<p class=MsoPlainText> 'reg_exp' => 'HELLO THERE!',<o:p></o:p></p>
<p class=MsoPlainText> },<o:p></o:p></p>
<p class=MsoPlainText>);<o:p></o:p></p>
<p class=MsoPlainText>1;<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>