PLease help

Harper Mann hmann at itgroundwork.com
Tue Oct 11 18:36:42 CEST 2005


   Did you try running the script from user "nagios"?  It's often a
   permission problem.
   Also, you generally want to put the full path to commands in the
   script so the env is good:
   /bin/rm
   /bin/echo
   Etcetera...
   Regards,
   - Harper
   Harper Mann
   Groundwork Open Source Solutions
   510-599-2075 (cell)
   Forough, Hamid wrote:

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: [1]nagios-users-admin at lists.sourceforge.net
[[2]mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Marc
Powell
Sent: Tuesday, October 11, 2005 10:51 AM
To: [3]nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] PLease help





-----Original Message-----
From: [4]nagios-users-admin at lists.sourceforge.net [[5]mailto:nagios-users-
[6]admin at lists.sourceforge.net] On Behalf Of Forough, Hamid
Sent: Tuesday, October 11, 2005 10:46 AM
To: [7]nagios-users at lists.sourceforge.net
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


Presuming you already know how to perform your query from a script this
should be all you need --

[8]http://nagiosplug.sourceforge.net/developer-guidelines.html

--
Marc


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads,
discussions,
and more. [9]http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nagios-users mailing list
[10]Nagios-users at lists.sourceforge.net
[11]https://lists.sourceforge.net/lists/listinfo/nagios-users
::: 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. [12]http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nagios-users mailing list
[13]Nagios-users at lists.sourceforge.net
[14]https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting an
y issue.
::: Messages without supporting info will risk being sent to /dev/null

References

   1. mailto:nagios-users-admin at lists.sourceforge.net
   2. mailto:nagios-users-admin at lists.sourceforge.net
   3. mailto:nagios-users at lists.sourceforge.net
   4. mailto:nagios-users-admin at lists.sourceforge.net
   5. mailto:nagios-users
   6. mailto:admin at lists.sourceforge.net
   7. mailto:nagios-users at lists.sourceforge.net
   8. http://nagiosplug.sourceforge.net/developer-guidelines.html
   9. http://solutions.newsforge.com/ibmarch.tmpl
  10. mailto:Nagios-users at lists.sourceforge.net
  11. https://lists.sourceforge.net/lists/listinfo/nagios-users
  12. http://solutions.newsforge.com/ibmarch.tmpl
  13. mailto:Nagios-users at lists.sourceforge.net
  14. https://lists.sourceforge.net/lists/listinfo/nagios-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051011/1b2d483d/attachment.html>


More information about the Users mailing list