<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
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;}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Verdana",sans-serif;
color:black;}
span.EmailStyle19
{mso-style-type:personal-compose;
font-family:"Verdana",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></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-NZ" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Isn’t this just checking the Nagios process on the second server? Your service has host_name specified, but the command doesn’t actually use it (it only queries
local host).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">You could run e.g. nrpe on the primary server. Create a command to run check_nagios. Then on the second server run check_nrpe.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Or else rather than running check_nagios on the second server, run a script that connects to primary server via ssh and runs check_nrpe.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Or if you’re running mk_livestatus on your primary you could query it from secondary. Create check_nrpe on primary and then just query the status of it from secondary.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Someone else would be able to suggest better, but these are quick and dirty ;)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="mso-fareast-language:EN-NZ">From:</span></b><span lang="EN-US" style="mso-fareast-language:EN-NZ"> Help [mailto:help-bounces+gareth.fletcher=onenet.co.nz@monitoring-plugins.org]
<b>On Behalf Of </b>Ditmar Tavares<br>
<b>Sent:</b> Friday, 19 December 2014 5:06 a.m.<br>
<b>To:</b> help@monitoring-plugins.org<br>
<b>Subject:</b> check_nagios plugin<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-CA">I’m new to Linux and also to Nagios monitoring, so it may be something that I’m missing.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">I setup a second Nagios server so I can monitor my primary Nagios server, basically if the primary Nagios stop monitoring I would like to know via the secondary Nagios.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Issue is that I setup the check_nagios plugin and its giving me the status of the Nagios process of the primary server, but when I shutoff the Nagios process on the primary server (for testing), I am NOT getting any notification
from the secondary server that something is wrong with the primary, and its also keeps telling me the process on the primary servers is OK.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">Could you please assist ? thank you in advance.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">See my host service definition below.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">define service {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> use generic-service<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> host_name ClearMon02<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> service_description Nagios<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> check_command check_nagios<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> notifications_enabled 1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">My command definition is below<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA">define command{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> command_name check_nagios<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> command_line $USER1$/check_nagios -F /usr/local/nagios/var/status.dat -e 1 -t 15 -C /usr/local/nagios/bin/nagios<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:EN-NZ"><br>
______________________________________________________________________<br>
This email has been scanned by the Symantec Email Security.cloud service.<o:p></o:p></span></p>
</div>
</body>
</html>