<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Did you try running the script from user "nagios"? It's often a
permission problem.<br>
<br>
Also, you generally want to put the full path to commands in the script
so the env is good:<br>
<br>
/bin/rm<br>
/bin/echo<br>
<br>
Etcetera...<br>
<br>
Regards,<br>
<br>
- Harper<br>
<br>
Harper Mann<br>
Groundwork Open Source Solutions<br>
510-599-2075 (cell)<br>
<br>
Forough, Hamid wrote:
<blockquote
cite="mid360C39FD92313F48A74A60471FA38E87013559F4@SAUSEXMB1.amd.com"
type="cite">
<pre wrap="">Thanks for that. I have almost completed it except for following:
I have a custom shell that checks the existence of a file on linux and
sends the correct result. This is the piece of the code that I have
question:
. . .
if test -e "/usr/lib/nagios/plugins/out.txt"
then
echo "Jobs XXFAILED"
rm -f /usr/lib/nagios/plugins/out.txt
exit 2
else
echo "Jobs XXSUCCEEDED"
rm -f /usr/lib/nagios/plugins/out.txt
exit 0
fi
The problem is when I run this file directly from linux, I get the echo
correctly and the files gets deleted. But when ran from Nagios, the echo
gets returned BUT IT DOES NOT DELETE THE FILE. Do u know why?
-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:nagios-users-admin@lists.sourceforge.net">nagios-users-admin@lists.sourceforge.net</a>
[<a class="moz-txt-link-freetext" href="mailto:nagios-users-admin@lists.sourceforge.net">mailto:nagios-users-admin@lists.sourceforge.net</a>] On Behalf Of Marc
Powell
Sent: Tuesday, October 11, 2005 10:51 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a>
Subject: RE: [Nagios-users] PLease help
</pre>
<blockquote type="cite">
<pre wrap="">-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:nagios-users-admin@lists.sourceforge.net">nagios-users-admin@lists.sourceforge.net</a> [<a class="moz-txt-link-freetext" href="mailto:nagios-users">mailto:nagios-users</a>-
<a class="moz-txt-link-abbreviated" href="mailto:admin@lists.sourceforge.net">admin@lists.sourceforge.net</a>] On Behalf Of Forough, Hamid
Sent: Tuesday, October 11, 2005 10:46 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:nagios-users@lists.sourceforge.net">nagios-users@lists.sourceforge.net</a>
Subject: [Nagios-users] PLease help
I need to know how to write a custom plugin that checks results of a
stored procedure in MSSQL 2k and returns Yes or NO? I am using 2b4
verision of Nagios
</pre>
</blockquote>
<pre wrap=""><!---->
Presuming you already know how to perform your query from a script this
should be all you need --
<a class="moz-txt-link-freetext" href="http://nagiosplug.sourceforge.net/developer-guidelines.html">http://nagiosplug.sourceforge.net/developer-guidelines.html</a>
--
Marc
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads,
discussions,
and more. <a class="moz-txt-link-freetext" href="http://solutions.newsforge.com/ibmarch.tmpl">http://solutions.newsforge.com/ibmarch.tmpl</a>
_______________________________________________
Nagios-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when
reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. <a class="moz-txt-link-freetext" href="http://solutions.newsforge.com/ibmarch.tmpl">http://solutions.newsforge.com/ibmarch.tmpl</a>
_______________________________________________
Nagios-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</a>
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
</pre>
</blockquote>
<br>
</body>
</html>