<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Sep 4, 2006, at 5:39 AM, Ranjeet Kumar wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV class="Section1"><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Hi,</SPAN></FONT></P><DIV><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"> </SPAN></FONT><BR class="khtml-block-placeholder"></DIV><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Can anyone give me idea how to integrate Nagios & MRTG?</SPAN></FONT></P><DIV><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"> </SPAN></FONT><BR class="khtml-block-placeholder"></DIV><DIV><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial"> </SPAN></FONT><BR class="khtml-block-placeholder"></DIV><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Thanks,</SPAN></FONT></P><P class="MsoNormal"><FONT size="2" face="Arial"><SPAN style="font-size:10.0pt; font-family:Arial">Ranjeet</SPAN></FONT></P><DIV><FONT size="3" face="Times New Roman"><SPAN style="font-size: 12.0pt"> </SPAN></FONT><BR class="khtml-block-placeholder"></DIV> </DIV> <TABLE><TBODY><TR><TD bgcolor="#ffffff"><FONT color="#000000"><BR> The information contained in, or attached to, this e-mail, contains confidential information and is intended solely for the use of the individual or entity to whom they are addressed and is subject to legal privilege. If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager. Please do not copy it for any purpose, or disclose its contents to any other person. The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. The recipient should check this e-mail and any attachments for the presence of viruses. The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.<BR> <BR> <A href="http://www.aztecsoft.com">www.aztecsoft.com</A><BR> </FONT></TD></TR></TBODY></TABLE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-------------------------------------------------------------------------</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Using Tomcat but need to do more? Need to support web services, security?</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Get stuff done quickly with pre-integrated technology to make your job easier</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________">http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Nagios-users mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Nagios-users@lists.sourceforge.net">Nagios-users@lists.sourceforge.net</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="https://lists.sourceforge.net/lists/listinfo/nagios-users">https://lists.sourceforge.net/lists/listinfo/nagios-users</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">::: Messages without supporting info will risk being sent to /dev/null</DIV> </BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I did the following, after setting up both nagios and MRTG separately. First, for each host that MRTG is monitoring, define one or more services in nagios (for example, if MRTG is monitoring the traffic on three ports of a router, you will need three services in Nagios). These services are then set up to use the check_mrtgtraf plugin. This plugin gives a result based on the traffic that MRTG is seeing. My check command for this is defined as follows:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>define command{</DIV><DIV> command_name check_mrtgtraf</DIV><DIV> command_line $USER1$/check_mrtgtraf -F /usr/local/mrtg-2/share/mrtg2/$ARG1$.log -w $ARG2$ -c $ARG3$</DIV><DIV> }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>where the arguments are the name of the log file MRTG creates for the device being monitored, the traffic level at which to give a warning status, and the traffic level at which to give a critical status (see check_mrtgtraf --help for more info). Depending on how you have this set up, you should be able to simplify the command somewhat by using the $HOSTADDRESS$ macro. The path to the log files will, of course, depend on your MRTG setup. To link the MRTG graphs in to the services, I simply used a serviceextinfo declaration for each service, and defined the notes_url property as the webpage that MRTG creates with the graph for the device. In my case, I put in a separate definition for each port pointing to the detail webpage for that port, you could, of course, choose to simply make one definition pointing to the summary webpage.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This may not be the most "integrated" approach possible, but it does give me the ability to have nagios send me notifications (or whatever) based on the traffic information gathered by MRTG, as well as giving me easy access to the MRTG graphs from within nagios. You could take a similar approach using the check_mrtg plugin instead, if you wanted nagios to pay attention to information other than what the check_mrtgtraf plugin returns, but I haven't looked into this. A couple of caveats:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>1) the version of the check_mrtgtraf plugin I had, for some reason, wasn't coded to ever set the output status to 'OK'. I don't know if that was a bug in the source code in general, or just the version I got, but I had to add code to set the output to OK and recompile before it would work for me. Simple enough (at least if you know basic C programing).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>2) The plug in, as written, reports and sets warning states based on the incoming and outgoing traffic separately, with independent warning/critical thresholds for each. This may well be what you want. In our case, however, I was more interested in the TOTAL traffic- if the traffic in is 128 kb/s and the traffic out is also 128 kb/s, then our 256 kb/s link is saturated, and I wanted nagios to return critical, even though neither the inbound or the outbound traffic is by itself enough to warrant a critical state. Again, I was easily able to modify the plugin source to do this, but this may not be desirable in other situations.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-------------------------------------</DIV><DIV>Israel Brewster</DIV><DIV>Computer Support Technician</DIV><DIV>Frontier Flying Service, Inc.</DIV><DIV>5245 Airport industrial Rd.</DIV><DIV>Fairbanks, AK 99709</DIV><DIV>--------------------------------------</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR class="Apple-interchange-newline"></SPAN> </DIV><BR></BODY></HTML>