<div>Many users assume that people aready are familiar with the little steps,</div>
<div> </div>
<div>I agree that it is nice to see some real life examples spelled out some times.</div>
<div> </div>
<div>Personally I always recomed people new to Nagios to keep All the Config Files </div>
<div>under some kind of source control. (CVS or some other system)<br></div>
<div>Tony<br></div>
<div class="gmail_quote">On Thu, Mar 5, 2009 at 6:41 AM, Martyn <span dir="ltr"><<a href="mailto:martyn@chetnet.co.uk">martyn@chetnet.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div text="#000000" bgcolor="#ffffff">
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2">Brill, this is the kind of thing that helps me learn how to use programs, wish a few more would post things like this.</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font face="Arial" color="#0000ff" size="2">Cheers</font></span></div><br>
<div lang="en-us" dir="ltr" align="left">
<hr>
<font face="Tahoma" size="2"><b>From:</b> vinod.e [mailto:<a href="mailto:vinod.e@enlume.com" target="_blank">vinod.e@enlume.com</a>] <br><b>Sent:</b> 05 March 2009 10:57<br><b>To:</b> <a href="mailto:Nagios-users@lists.sourceforge.net" target="_blank">Nagios-users@lists.sourceforge.net</a><br>
<b>Subject:</b> [Nagios-users] How to monitor using custom scripts in nagios.<br></font><br></div>
<div>
<div></div>
<div class="h5">
<div></div>Hi Friends,<br>I Want <big>share My experience</big>  of   monitoring  scripts on  nagios , Very simple and Easy.<br><big>I am 3 months experienced with nagios  and  u should  make copy of all your modifying  files initially.<br>
</big><br>Actually I want to  monitor tomcat threads,memory etc.. along with other services , i could not find plug ins similar  to  mysql.<br>In my office  we have inbuilt scripts  to monitor  tomcat manually.<br>On test bases I had taken one of this script  and tested , I had success.<br>
There are other ways <big>thanks to</big> <big>Mr.Richard Quintin</big>  who  shared his knowledge of using nagiosgraph  and scripts to monitor tomcat but my suse10.2 , monitoring server have few issues i  could not go head instead tried this.<br>
<br><big>Monitoring   nagios using  scripts.</big><br>Example:<br>Monitoring tomcat Threads.<br><br><font size="+1">At remote host side i.e where nrpe is installed / monitored box</font><br><br>Created a file tomcat_threads.sh using vi editor<br>
<br>#vi tomcat_threads.sh<br>Entered  following  three line code<br><br>#!/bin/sh<br>totalThreads=`ps -C java -L -o pid,tid,pcpu,state | wc -l`<br>echo "Total Threads Available:$totalThreads"<br><br>Save the file and quit<br>
<br>Made sure first  script runs at  # prompt.<br><br>Moved script to  /usr/local/nagios/libexec  folder if its not created here.<br><br>Set permission<br>#chmod  755 tomcat_threads.sh<br><br>Give ownner ship to nagios user only.<br>
#chown   nagios:nagios  tomcat_threads.sh<br><br><br>#cd /usr/local/nagios/etc<br>#vi nrpe.cfg<br><br>Append below command  line<br><br>command[tomcat_threads.sh]=/usr/local/nagios/libexec/tomcat_threads.sh<br><br>Save and quit<br>
<br>Restart  xinetd to make  changes effected.<br>#service xinetd restart<br><big><br><br>At monitoring server side /  where nagios monitoring  server  installed</big>.<br>#cd /usr/local/nagios/etc/<br><br>#vi services.cfg<br>
Append this  service<br><br>define service{<br>          use                              generic-service<br>          host_name                   amazon<br>         service_description       tomcat_threads.sh<br>        check_command           check_nrpe!tomcat_threads.sh<br>
         notifications_enabled     0<br>         }<br><br>Save and quit<br><br>check for erorrs <br>#/usr/local/nagios/bin /nagios -v  /usr/local/nagios/etc/nagios.cfg<br>correct your erorror if any.<br><br>Restart nagios service<br>
#service nagios restart<br>   <br><big>DISCLAIMER:<br>This is what worked for me  and i am confident i will add as many as scripts i want in future.<br>You make changes as it suits to you and i own no responsibility  for typo error or if some thing  goes wrong.</big><br>
<br><big>Please share your knowledge, knowledges grows by sharing while money  reduces by sharing. </big><br><br>Regards<br>Gajula Vinod Kumar Eleshetty<br>SYSTEM ADMINISTRATOR/DATA BASE ADMINISTRATOR<br>Enlume technologis.<br>
<br><br><br></div></div></div><br>------------------------------------------------------------------------------<br>Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA<br>-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise<br>
-Strategies to boost innovation and cut costs with open source participation<br>-Receive a $600 discount off the registration fee with the source code: SFAD<br><a href="http://p.sf.net/sfu/XcvMzF8H" target="_blank">http://p.sf.net/sfu/XcvMzF8H</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 any issue.<br>::: Messages without supporting info will risk being sent to /dev/null<br></blockquote></div><br>