<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:"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:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","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;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>diff shows the only difference is the ‘-x /sys /dev’ on the one server.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Removing that gives me as before:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>/usr/lib/nagios/plugins/check_nrpe -H sys1 -c check_all_disk 20% 10%<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>DISK CRITICAL - /sys is not accessible: Permission denied<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>but adding nagios to wheel, and changing the nrpe command to this:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>command[check_all_disk]=sudo /usr/lib/nagios/plugins/check_disk -w $ARG1$ -c $ARG2$<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>results in something completely unexpected:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>/usr/lib/nagios/plugins/check_nrpe -H sys1 -c check_all_disk 20% 10%<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>NRPE: Unable to read output<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Claudio Kuenzler [mailto:ck@claudiokuenzler.com] <br><b>Sent:</b> Monday, March 12, 2012 1:43 PM<br><b>To:</b> Nagios Users List<br><b>Subject:</b> Re: [Nagios-users] check_disk '/sys not accessable'<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div style='margin-left:30.0pt'><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Doing the next obvious thing and including /dev in the excludes works, and is a workaround.</span><o:p></o:p></p></div></blockquote><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>Good, but workarounds aren't that nice ;-)<br><br>Before we think too far, could you make a diff of your different nrpe.cfg's?<br>Maybe you include another file in which the command <span style='font-family:"Calibri","sans-serif"'>check_all_disk </span>is defined a second time?<br>That would be a simple explanation...<br><br><br>What happens if you add a sudoers entry to allow the nagios user (or the user you're running the nrpe daemon as) to launch check_disk? Modify the check_command so you use sudo before the check_disk command.<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Mon, Mar 12, 2012 at 6:32 PM, davor grgicevic <<a href="mailto:dgrgicevic@gmail.com">dgrgicevic@gmail.com</a>> wrote:<o:p></o:p></p><p class=MsoNormal>Hi Timothy<br><br>localy u r workiong as root.. if you try as user Nagios, it<br>wont work ..<br><br>u have to run sudo for this<o:p></o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><br>"DISK CRITICAL - /dev/pts is not accessible: Permission denied"<o:p></o:p></p></div><p class=MsoNormal>davor<br><br><br><br>On Mon, Mar 12, 2012 at 6:17 PM, Boyer, Timothy A.<o:p></o:p></p><div><div><p class=MsoNormal><<a href="mailto:Timothy.Boyer@opm.gov">Timothy.Boyer@opm.gov</a>> wrote:<br>> $ ./check_disk -w 10% -c 5% -p /sys<br>><br>> DISK UNKNOWN - free space:|<br>><br>><br>><br>> is the result on both servers.<br>><br>><br>><br>> But that’s running locally, which works. The problem is when running via<br>> nrpe.<br>><br>><br>><br>> Running check_nrpe with –x /sys in the command line returns:<br>><br>><br>><br>> DISK CRITICAL - /dev/pts is not accessible: Permission denied<br>><br>><br>><br>> Doing the next obvious thing and including /dev in the excludes works, and<br>> is a workaround.<br>><br>><br>><br>> Thanks much…<br>><br>><br>><br>><br>><br>> From: Claudio Kuenzler [mailto:<a href="mailto:ck@claudiokuenzler.com">ck@claudiokuenzler.com</a>]<br>> Sent: Friday, March 09, 2012 7:46 AM<br>> To: Nagios Users List<br>><br>><br>> Subject: Re: [Nagios-users] check_disk '/sys not accessable'<br>><br>><br>><br>> Nagios 3.3.1. Two identical RHEL6.1 systems, and all I’m trying to do is<br>> get a total disk space reading.<br>><br>><br>> Well the systems are not identical as the manually launched plugin output of<br>> yours shows:<br>><br>> [nagios@server1 ~)$ /usr/lib/nagios/plugins/check_disk -w20% -c10%<br>><br>> DISK OK - free space: / 24673 MB (98% inode=99%); /dev/shm 12007 MB (100%<br>> inode=99%); /boot 154 MB (65% inode=99%); /home 7507 MB (98% inode=99%);<br>><br>><br>><br>> [nagios@server2 /]$ /usr/lib/nagios/plugins/check_disk -w20% -c10%<br>> DISK OK - free space: / 22004 MB (77% inode=96%); /dev/shm 498 MB (100%<br>> inode=99%); /boot 387 MB (84% inode=99%);<br>><br>><br>> Note the /home mount point.<br>><br>> Have you checked the servers for the different mount points? It looks like<br>> on server2 /sys is seen as a partition or mount point while on server1 the<br>> check seems to "ignore" it successfully? Any idea why server2 thinks /sys is<br>> a partition or mount point?<br>><br>> Can you try to launch it specifically on /sys and output the results (on<br>> both servers)?<br>><br>> ./check_disk -w 10% -c 5% -p /sys<br>><br>> Then try to exclude /sys from the check:<br>><br>> ./check_disk -w 10% -c 5% -x /sys<br>><br>> By the way the error you're seeing seems to be triggered from this code (at<br>> the bottom of the source file):<br>><br>> void<br>> stat_path (struct parameter_list *p)<br>> {<br>> /* Stat entry to check that dir exists and is accessible */<br>> if (verbose >= 3)<br>> printf("calling stat on %s\n", p->name);<br>> if (stat (p->name, &stat_buf[0])) {<br>> if (verbose >= 3)<br>> printf("stat failed on %s\n", p->name);<br>> printf("DISK %s - ", _("CRITICAL"));<br>> die (STATE_CRITICAL, _("%s %s: %s\n"), p->name, _("is not accessible"),<br>> strerror(errno));<br>> }<br>> }<br>><br>><br>><br>> On Fri, Mar 9, 2012 at 1:16 PM, Boyer, Timothy A. <<a href="mailto:Timothy.Boyer@opm.gov">Timothy.Boyer@opm.gov</a>><br>> wrote:<br>><br>> It's Permissive, so that can't be it. Thanks...<br>><br>><br>> -----Original Message-----<br>> From: Sigmund Brandstaetter [mailto:<a href="mailto:sb@maniladev.com">sb@maniladev.com</a>]<br>> Sent: Thursday, March 08, 2012 4:12 PM<br>> To: <a href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a><br>> Subject: Re: [Nagios-users] check_disk '/sys not accessable'<br>><br>> Tim,<br>><br>> How about SELinux, is it maybe on only on the one that is making the<br>> problem?<br>><br>> Cheers<br>> Sigmund<br>><br>><br>><br>> On 3/9/2012 00:49, Boyer, Timothy A. wrote:<br>>> Nagios 3.3.1. Two identical RHEL6.1 systems, and all I'm trying to do<br>>> is get a total disk space reading. So nrpe is running on both, with<br>>> the identical command in nrpe.cfg:<br>>> command[check_all_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$<br>>> -c $ARG2$<br>>> command[check_all_disk]=/usr/lib/nagios/plugins/check_disk -w $ARG1$<br>>> -c $ARG2$<br>>> Running as user nagios from the central server.<br>>> One works fine:<br>>> -sh-4.1$ /usr/lib/nagios/plugins/check_nrpe -H server1 -c<br>>> check_all_disk -a 20% 10%<br>>> DISK OK - free space: / 24673 MB (98% inode=99%); /dev/shm 12007 MB<br>>> (100% inode=99%); /boot 154 MB (65% inode=99%); /home 7507 MB (98%<br>>> inode=99%);<br>>> the other gives me this:<br>>> -sh-4.1$ /usr/lib/nagios/plugins/check_nrpe -H server2 -c<br>>> check_all_disk -a 20% 10%<br>>> DISK CRITICAL - /sys is not accessible: Permission denied<br>>> Identical versions of nrpe (2.12); a diff on check_disk shows they're<br>>> both identical; both commands work correctly locally run as user Nagios:<br>>> [nagios@server1 ~)$ /usr/lib/nagios/plugins/check_disk -w20% -c10%<br>>> DISK OK - free space: / 24673 MB (98% inode=99%); /dev/shm 12007 MB<br>>> (100% inode=99%); /boot 154 MB (65% inode=99%); /home 7507 MB (98%<br>>> inode=99%);<br>>> [nagios@server2 /]$ /usr/lib/nagios/plugins/check_disk -w20% -c10%<br>>> DISK OK - free space: / 22004 MB (77% inode=96%); /dev/shm 498 MB<br>>> (100% inode=99%); /boot 387 MB (84% inode=99%);<br>>> Multiple other nrpe commands running on both; this is the only thing<br>>> they're having problems with.<br>>> /sys is user-readable in both. Logs show nothing.<br>><br>>> I've run out of ideas. Pointers in the right direction appreciated...<br>><br>>> Tim<br>>><br>>><br>>><br>>> ------------------------------------------------------------------------------<br>>> Virtualization& Cloud Management Using Capacity Planning<br>>> Cloud computing makes use of virtualization - but cloud computing<br>>> also focuses on allowing computing to be delivered as a service.<br>>> <a href="http://www.accelacomm.com/jaw/sfnl/114/51521223/" target="_blank">http://www.accelacomm.com/jaw/sfnl/114/51521223/</a><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 href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>>> ::: Please include Nagios version, plugin version (-v) and OS when<br>>> reporting any issue.<br>>> ::: Messages without supporting info will risk being sent to /dev/null<br>><br>><br>> --<br>> ---------------------<br>> Sigmund Brandstaetter<br>> Check my Blog<br>> Live from Manila<br>> <a href="http://maniladev.com" target="_blank">http://maniladev.com</a><br>> ---------------------<br>><br>><br>> ------------------------------------------------------------------------------<br>> Virtualization & Cloud Management Using Capacity Planning<br>> Cloud computing makes use of virtualization - but cloud computing<br>> also focuses on allowing computing to be delivered as a service.<br>> <a href="http://www.accelacomm.com/jaw/sfnl/114/51521223/" target="_blank">http://www.accelacomm.com/jaw/sfnl/114/51521223/</a><br>> _______________________________________________<br>> Nagios-users mailing list<br>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>> ::: Please include Nagios version, plugin version (-v) and OS when reporting<br>> any issue.<br>> ::: Messages without supporting info will risk being sent to /dev/null<br>><br>> ------------------------------------------------------------------------------<br>> Virtualization & Cloud Management Using Capacity Planning<br>> Cloud computing makes use of virtualization - but cloud computing<br>> also focuses on allowing computing to be delivered as a service.<br>> <a href="http://www.accelacomm.com/jaw/sfnl/114/51521223/" target="_blank">http://www.accelacomm.com/jaw/sfnl/114/51521223/</a><br>> _______________________________________________<br>> Nagios-users mailing list<br>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>> ::: Please include Nagios version, plugin version (-v) and OS when reporting<br>> any issue.<br>> ::: Messages without supporting info will risk being sent to /dev/null<br>><br>><br>><br>><o:p></o:p></p></div></div><p class=MsoNormal>> ------------------------------------------------------------------------------<br>> Try before you buy = See our experts in action!<br>> The most comprehensive online learning library for Microsoft developers<br>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,<br>> Metro Style Apps, more. Free future releases when you subscribe now!<br>> <a href="http://p.sf.net/sfu/learndevnow-dev2" target="_blank">http://p.sf.net/sfu/learndevnow-dev2</a><o:p></o:p></p><div><p class=MsoNormal>> _______________________________________________<br>> Nagios-users mailing list<br>> <a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br>> <a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">https://lists.sourceforge.net/lists/listinfo/nagios-users</a><br>> ::: Please include Nagios version, plugin version (-v) and OS when reporting<br>> any issue.<br>> ::: Messages without supporting info will risk being sent to /dev/null<br><br>------------------------------------------------------------------------------<o:p></o:p></p></div><p class=MsoNormal>Try before you buy = See our experts in action!<br>The most comprehensive online learning library for Microsoft developers<br>is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,<br>Metro Style Apps, more. Free future releases when you subscribe now!<br><a href="http://p.sf.net/sfu/learndevnow-dev2" target="_blank">http://p.sf.net/sfu/learndevnow-dev2</a><o:p></o:p></p><div><div><p class=MsoNormal>_______________________________________________<br>Nagios-users mailing list<br><a href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a><br><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank">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<o:p></o:p></p></div></div></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>