<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6249.1">
<TITLE>RE: [Nagios-users] parameters for service checks from outside nagios</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I'm going to go on a bit of a tangent here.  Maybe what you're interested in doing is to have the datfiles consistent and up-to-date, and not test whether they are or not.  Sure, the test would be valuable, but it might be redundant.  Allow me to illustrate....</FONT></P>

<P><FONT SIZE=2>Set up an rsync server internally.  (It doesn't have to be anywhere; in fact, if you can keep it on a separate server, all the better.)  Always put the latest/greatest datfile on your rsync server.  Run a cronjob as frequently as you'd like (once a day, once an hour, whatever) on your rsync server to grab the latest datfile from the Internet.  Also set up cronjobs on each of your hosts (where the datfile needs to be kept up-to-date) to use the rsync protocol to grab this very same datfile from your rsync server and install locally.</FONT></P>

<P><FONT SIZE=2>Rsync is very good at optimizing traffic.  I don't think I could give a good enough description of it here.</FONT>
</P>

<P><FONT SIZE=2>Another approach would be to set up cfengine.  There may be others.</FONT>
</P>

<P><FONT SIZE=2>To save possible repetition, I recommend you check out www.infrastructures.org.</FONT>
</P>

<P><FONT SIZE=2>HTH.</FONT>
</P>

<P><FONT SIZE=2>jc</FONT>
</P>
<BR>

<P><FONT SIZE=2>> -----Original Message-----</FONT>

<BR><FONT SIZE=2>> From: Lennard Bakker [<A HREF="mailto:bakkerl@lamp.xs4all.nl">mailto:bakkerl@lamp.xs4all.nl</A>]</FONT>

<BR><FONT SIZE=2>> Sent: Thursday, January 02, 2003 6:18 PM</FONT>

<BR><FONT SIZE=2>> To: Carroll, Jim P [Contractor]; nagios-users@lists.sourceforge.net</FONT>

<BR><FONT SIZE=2>> Subject: RE: [Nagios-users] parameters for service checks from outside</FONT>

<BR><FONT SIZE=2>> nagios</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> nagios-users@lists.sourceforge.netOn Thu, 2003-01-02 at </FONT>

<BR><FONT SIZE=2>> 17:45, Carroll,</FONT>

<BR><FONT SIZE=2>> Jim P [Contractor] wrote:</FONT>

<BR><FONT SIZE=2>> > I'm not entirely sure how you're retrieving the datfiles, </FONT>

<BR><FONT SIZE=2>> but it might make</FONT>

<BR><FONT SIZE=2>> > sense to run a plugin locally on the remote systems in </FONT>

<BR><FONT SIZE=2>> question.  This</FONT>

<BR><FONT SIZE=2>> > plugin would scrub the datfile (eg, with grep); the result </FONT>

<BR><FONT SIZE=2>> of this plugin</FONT>

<BR><FONT SIZE=2>> > would be returned to Nagios.</FONT>

<BR><FONT SIZE=2>> The version is retreived by grepping, cutting, some awk and some other</FONT>

<BR><FONT SIZE=2>> tools on the output of the virusscanner version info. This is not the</FONT>

<BR><FONT SIZE=2>> problem.</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> The problem is how to let the plugin know what the current (uptodate)</FONT>

<BR><FONT SIZE=2>> version is. I want to result the plugin OK if uptodate, WARNING on 1</FONT>

<BR><FONT SIZE=2>> versions behind, ERROR on all other results.</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> The plugin is capable of getting the current used version, </FONT>

<BR><FONT SIZE=2>> now i have to</FONT>

<BR><FONT SIZE=2>> let it compare to the latest version. This information can be </FONT>

<BR><FONT SIZE=2>> fetched of</FONT>

<BR><FONT SIZE=2>> the internet, but if all hosts gets the information on every </FONT>

<BR><FONT SIZE=2>> check, this</FONT>

<BR><FONT SIZE=2>> would consumps a lot of bandwidth.</FONT>

<BR><FONT SIZE=2>> The information of the latest version is also known on the </FONT>

<BR><FONT SIZE=2>> nagios host.</FONT>

<BR><FONT SIZE=2>> So if the information (versionnumber) can be given to the remote host,</FONT>

<BR><FONT SIZE=2>> the plugin can also get his result (without fetching extra information</FONT>

<BR><FONT SIZE=2>> of the internet).</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> > Of course, I'm making some wild assumptions about your </FONT>

<BR><FONT SIZE=2>> environment, such as</FONT>

<BR><FONT SIZE=2>> > the system that hosts your datfiles is a *nix host.  If </FONT>

<BR><FONT SIZE=2>> it's Windows, I'm</FONT>

<BR><FONT SIZE=2>> > not entirely certain how you'd do it.  Still, you could </FONT>

<BR><FONT SIZE=2>> install OpenSSH and</FONT>

<BR><FONT SIZE=2>> > Perl on your Windows servers to facilitate this sleight of hand.</FONT>

<BR><FONT SIZE=2>> It is all Linux based. All windows checks are fase 2 for me.. ;-)</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> > In case I haven't been clear, you would be best off to </FONT>

<BR><FONT SIZE=2>> write your own plugin</FONT>

<BR><FONT SIZE=2>> > to do this.</FONT>

<BR><FONT SIZE=2>> The current check is a own written shell-script plugin. But </FONT>

<BR><FONT SIZE=2>> this plugin</FONT>

<BR><FONT SIZE=2>> fetches the info from the internet. </FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> I did try some thing..</FONT>

<BR><FONT SIZE=2>> method 1: check_nrpe!check_datfile</FONT>

<BR><FONT SIZE=2>> This gets the latest information from the internet.</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> method 2: check_by_ssh!"/bin/nagios/libexec/check_datfile2 4240"</FONT>

<BR><FONT SIZE=2>> With this method, the latest version is given to the remote host, and</FONT>

<BR><FONT SIZE=2>> not from the internet (here 4240). But this is now static in the</FONT>

<BR><FONT SIZE=2>> configuration file. I can't get this information variable </FONT>

<BR><FONT SIZE=2>> (readed from a</FONT>

<BR><FONT SIZE=2>> file or something, before it is passed to a remote host).</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> The only solution i can see now, is to call a local plugin on the</FONT>

<BR><FONT SIZE=2>> nagios-host. This shell scripts than uses nagios plugins </FONT>

<BR><FONT SIZE=2>> (check_by_ssh,</FONT>

<BR><FONT SIZE=2>> or check_nrpe) to get some result from a remote host, and </FONT>

<BR><FONT SIZE=2>> calculate the</FONT>

<BR><FONT SIZE=2>> result.</FONT>

<BR><FONT SIZE=2>> This solution is not wanted due to resoures on the nagios-server.</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> With greets,</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> Lennard Bakker</FONT>

<BR><FONT SIZE=2>> </FONT>

<BR><FONT SIZE=2>> > </FONT>

<BR><FONT SIZE=2>> > jc</FONT>

<BR><FONT SIZE=2>> > </FONT>

<BR><FONT SIZE=2>> > > -----Original Message-----</FONT>

<BR><FONT SIZE=2>> > > From: Lennard Bakker [<A HREF="mailto:bakkerl@lamp.xs4all.nl">mailto:bakkerl@lamp.xs4all.nl</A>]</FONT>

<BR><FONT SIZE=2>> > > Sent: Tuesday, December 31, 2002 4:26 PM</FONT>

<BR><FONT SIZE=2>> > > To: nagios-users@lists.sourceforge.net</FONT>

<BR><FONT SIZE=2>> > > Subject: [Nagios-users] parameters for service checks from outside</FONT>

<BR><FONT SIZE=2>> > > nagios</FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> > > Is it possible to import variable date to use with a </FONT>

<BR><FONT SIZE=2>> service check?</FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> > > My problem:</FONT>

<BR><FONT SIZE=2>> > > I want to let nagios to check anti virus datfiles on remote </FONT>

<BR><FONT SIZE=2>> > > systems. Now</FONT>

<BR><FONT SIZE=2>> > > i do this dat each remote system fetch the latest version </FONT>

<BR><FONT SIZE=2>> info (800k)</FONT>

<BR><FONT SIZE=2>> > > and verifies the version info, to the installed version </FONT>

<BR><FONT SIZE=2>> (no update is</FONT>

<BR><FONT SIZE=2>> > > done). The plugin reports OK if datfile is uptodate, </FONT>

<BR><FONT SIZE=2>> warning when 1</FONT>

<BR><FONT SIZE=2>> > > version behind and ERROR if more than 1 version behind </FONT>

<BR><FONT SIZE=2>> (or installed</FONT>

<BR><FONT SIZE=2>> > > version is newer then the official downloadable).</FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> > > The problem is that every client fetches the 800k just </FONT>

<BR><FONT SIZE=2>> for verify the</FONT>

<BR><FONT SIZE=2>> > > version number (4 bytes number).</FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> > > I have the lastest version info on the nagios host system </FONT>

<BR><FONT SIZE=2>> (in a file,</FONT>

<BR><FONT SIZE=2>> > > just 4 bytes in size). Is it possible to add this info </FONT>

<BR><FONT SIZE=2>> from a file to</FONT>

<BR><FONT SIZE=2>> > > the service check, so that the version number is given to te </FONT>

<BR><FONT SIZE=2>> > > remote host</FONT>

<BR><FONT SIZE=2>> > > (by nrpe or chack_by_ssh). The remote host doesn't have </FONT>

<BR><FONT SIZE=2>> to access a</FONT>

<BR><FONT SIZE=2>> > > remote host (internet) for the current information.</FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> > > Lennard</FONT>

<BR><FONT SIZE=2>> > > </FONT>

<BR><FONT SIZE=2>> </FONT>
</P>

</BODY>
</HTML>