Re: [Nagios-users] check snmp logic

2013-08-28 Thread Ben Sykes

 
Do you mean you want to check the result of one OID and make that treat
another OID's values differently?

Personally if I faced that problem - I would probably code a custom check
in Bash using snmpget from snmputils that did some nested If statements, or
use Net::SNMP from Perl and check it that way. Quite simple to write a
Nagios plugin - it's all about the exit values - 0 is OK, 1 is Warning, 2
is Critical, 3 is Unknown.

You may be able to use warning states generated by the first to define a
dependency on the second but it will be complicated to change the
thresholds dynamically via that method, at best you'd be able to suppress a
warning or other state from the 2nd but you couldn't have differential
thresholds between the two states of the first service without some work or
hackery (e.g. having an event trigger fire off that changes the
configuration file and reloads nagios)

I would just code it into a plugin (assuming you or someone on your team
can code)


Something like this perl pseudo code...

use Net::SNMP;

$snmp = Net::SNMP->session(-hostname => $ipaddress, -community => "public",
-version => 'snmpv2c');

@oids = qw/1.2.3.4 1.2.3.5/;

$res = $snmp->get_request(-varbindlist => \@oids);
unless(defined($res))
{
   print "UNKNOWN - no response\n";
   exit(3);
}

$firstoidval = $res->{$oids[0]};
$secondoidval = $res->{$oids[1]};

if ($firstoidval == 1)  #running?
{
   if ($secondoidval > 50) { print "CRITICAL - running and temp above
critical threshold"; exit(2); }
   if ($secondoidval > 45) { print "WARNING"; exit(1); }
   else { print "OK"; exit(0): }
}
elsif ($firstoidval == 0)  #notrunning?
{
   if ($secondoidval > 40) { print "CRITICAL"; exit(2); }
   if ($secondoidval > 35) { print "WARNING"; exit(1); }
   else { print "OK"; exit(0): }
}


Logic probably differs a bit, but you get the gist...


Cheers

Ben



ben sykes
consultant

m. +61 404 308 201
e. ben.sy...@transpire.com.auimage:
On Thu, Aug 29, 2013 at 11:27 AM, Mark Campbell  wrote:

> So I need to utilize some logic in my service checks.
>
> I have a chiller that if it is not running the discharge temp is not of
> concern.  However if it is running the discharge temp needs to be lower
> than 50 degrees.
>
> Is there a way to have the check snmp utilize some logic that says if
> running = 0 then ignore discharge temp.  If running = 1 then discharge
> temp must be <50 degrees?
>
> THe other option I thought of was using dependencies.  Anyone have
> suggestions on that?
>
>
>
>
> --
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
> ___
> Nagios-users mailing list
> Nagios-users@lists.sourceforge.net
> 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
>




legal disclaimer:

This email, including any attachments, may be confidential or privileged, and 
is sent for the personal attention of the intended recipient. If you have 
received this email in error, please delete it immediately. The views expressed 
are not necessarily those of Transpire Pty Ltd. Transpire is not liable for the 
effects of any virus which may be contained in this email.<><><>--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
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

Re: [Nagios-users] Return code of 127 is out of bounds - plugin may be missing error for check_memory.py

2013-04-15 Thread Ben Sykes
Try running the check as the nagios user and see what happens.

I ran into this problem also when I was using a very large number of
services (3500+) in a single service group, which I fixed by turning off
environment macros

On Mon, Apr 15, 2013 at 8:43 PM, nag ios  wrote:

> Hi,
>
> i have a problem while using check_memory.py plugin its poping up error as
> below.
>
> (Return code of 127 is out of bounds - plugin may be missing)
>
> permissions for the plugin as root and root for owner , group owner.
>
> Please help me out
>
>
> --
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> ___
> Nagios-users mailing list
> Nagios-users@lists.sourceforge.net
> 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
>

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
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

Re: [Nagios-users] Different notifications for different services

2013-03-28 Thread Ben Sykes
Just assign different contacts or contactgroups to the different hosts and
services, then set up different notification commands on those contacts
On Mar 29, 2013 2:04 AM, "Alex Trifonov"  wrote:

--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
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

[Nagios-users] Host List Sorting issues - WAN links with lots of hosts

2013-03-20 Thread Ben Sykes
Hi All,

Long time user, first time poster on the list.

I have a fairly large distributed monitoring setup currently in pilot
that's monitoring a variety of devices at remote branch sites.

The hostnames at all these sites are very similar since the naming standard
includes the branch ID at the start of the hostname.

What we are seeing is Nagios' scheduler is using a sorted list to drive the
host check scheduling decisions, which means all or the majority of devices
at a particular site are being checked at once. With all those ICMP packets
going down a long thin WAN link that may be close to 100% utilisation, we
are seeing all the devices at the site go down at once, then come back up
as soon as the next check is run in a more staggered manner.

I have checked the source code and the host list Nagios uses is sorted
after reading the config files and the scheduler routine simply walks the
linked list of hosts, and adds them into the schedule.

My ideas to solve it...

- Modify check_icmp with a wrapper script or similar that adds a random
delay to the ping check to avoid the mass of packets (OK but will still
lead to events where all the randomness adds up)
- Modify the Nagios source code and recompile to remove the sorting of host
lists (suboptimal)
- Increase the thresholds for ping timeouts etc (doesn't really let us
track latency of each site as it's then affected by the ping grouping)

Any ideas from the community that'd be useful?

Thanks

Ben Sykes

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
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