[Nagios-users] nagiosgrapher and service_descriptions between Windows/UNIX

2011-04-07 Thread Matthew Angelo
Hi team

Can someone please help me understand the way NagiosGrapher works (or
is meant to work) in relation to mapping the same service_description
name with different nrpe clients?

For example:

Windows Host:  WINSERV
CentOS Host:  LINUXSERV

Both have "Swap Usage" BUT because it's Windows vs UNIX -- the NRPE
clients return different graph_perf_regex and graph_log_regex strings.

#  check_nrpe -H LINUXSERV -c check_swap
SWAP OK - 100% free (4000 MB out of 4000 MB) |swap=4000MB;800;400;0;4000
# check_nrpe -H WINSERV -c check_swap
OK: virtual memory: 47.5M|'virtual memory %'=2%;90;95; 'virtual
memory'=47.45M;1843.08;1945.48;0;2047.87;


How do I account for this in my check_swap.ncfg?  The 'standard' one
that ships with ngraph works fine with UNIX, but I'm trying to add the
Windows NRPE string to also match and graph.

#---
#NagiosGrapherTemplateforcheck_swap
#---

##
##
## To support LINUX NRPE Clients
##
##
define ngraph{
service_nameSwap Usage
graph_log_regex (\d+)%
graph_value swap
graph_units percent
graph_legendfree swap space
rrd_plottypeAREA
rrd_color   00a000
hideyes
graph_uper_limit100
}

define ngraph{
service_nameSwap Usage
typeCDEF
graph_value swapdef
graph_units percent
graph_legendused swap space
graph_calc
swap,UNKN,NE,swap,0,IF,100,LE,swap,100,IF,100,-,-1,*
rrd_plottypeAREA
rrd_color   a0
}

##
##
## To Support Windows NRPE Clients
##
##

define ngraph{
service_nameSwap Usage
graph_perf_regexvirtual memory %=(\d+)%
graph_value swap_usage
graph_units %
graph_legendSwap Usage (percent)
rrd_plottypeAREA
rrd_color   a0  # maroon
graph_uper_limit100
}


#[EOF]



2011-04-08 16:47:44 REGEX: 2 blocks for 'Swap Usage' found.
2011-04-08 16:47:44 REGEX: graph_value=swap
2011-04-08 16:47:44 REGEX: output=plugin.
2011-04-08 16:47:44 REGEX: regex=m/(\d+)%/i
2011-04-08 16:47:44 REGEX: perfdata=swap ok - 67% free (1358 mb out of 2047 mb)
2011-04-08 16:47:44 REGEX: match=67
2011-04-08 16:47:44 REGEX: graph_value=swap_usage
2011-04-08 16:47:44 REGEX: output=perfdata
2011-04-08 16:47:44 REGEX: regex=m/virtual memory %=(\d+)%/i
2011-04-08 16:47:44 REGEX: perfdata=swap=1358MB;409;204;0;2047
2011-04-08 16:47:44 REGEX: NO MATCH.

As you can see from my check_swap.ncfg, I added Windows support (which
doesn't work).  ngraph.log shows that it finds 2 "blocks"but it
appears to only perform an "rrd update" *IF* ALL blocks match?  For
me, this will never be the case.  I expect only one block to match
(either the Windows block, or the UNIX block).

I have the regex and graphing working *IF* I give Windows a different
service_description ("Swap File Usage") but it doesn't feel right.
Trying to make them work "together" only appears to make it break.

Anyone have any tips/pointers?

Thanks!

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
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] (no subject)

2011-04-07 Thread John Maclean

/dev/BlackBerry®
--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
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] Service failover dependency

2011-04-07 Thread Mike Lindsey
On 4/7/11 2:45 AM, Andrey Mitroshin wrote:
> I'm afraid I did not explained my problem clearly.
>
> So, I've got 2 servers.
> serverA - primary (10.0.0.1)
> serverB - backup (10.1.0.1)
>
> There is some apache vhost named www.site.com configured on both of them.
> My failover is supposed to work as follows.
>
> Usually serverA is up and www.site.com resolves to 10.0.0.1.
> when serverA.com goes down, nagios executes evenhandler, updates A
> record  and www.site.com points to 10.1.0.1 (serverB).
>
> The problem arises when both servers are down. So, evenhandler updates
> A record of www.sites.com, but serverB is down as well
>
> My goal is to avoid executing eventhandler when serverB is down.
> And the question is how to configure such a behaviour in nagios.
What you need here, is a smarter event handler.  In the event handler 
script, have it test serverB.  If serverB is up, update the A record; 
otherwise just exit (and maybe update a logfile somewhere).

-- 
Mike Lindsey


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
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] Service failover dependency

2011-04-07 Thread Andrey Mitroshin
I'm afraid I did not explained my problem clearly.

So, I've got 2 servers. 
serverA - primary (10.0.0.1)
serverB - backup (10.1.0.1)

There is some apache vhost named www.site.com configured on both of them. 
My failover is supposed to work as follows.

Usually serverA is up and www.site.com resolves to 10.0.0.1.
when serverA.com goes down, nagios executes evenhandler, updates A
record  and www.site.com points to 10.1.0.1 (serverB).

The problem arises when both servers are down. So, evenhandler updates
A record of www.sites.com, but serverB is down as well

My goal is to avoid executing eventhandler when serverB is down.
And the question is how to configure such a behaviour in nagios.

On Thu, Apr 07, 2011 at 09:26:18AM +, Assaf Flatto wrote:
> Andrey Mitroshin wrote:
> > Hello,  
> > 
> >  
> > I'm about to implement simple failover scenario with nagios. It consists of
> > host A, host B and nagios host. When host A is down nagios executes
> > event handler which performs dynamic dns update on some hostname to
> > point it to host B. But when host B is down, nagios should not execute
> > event handler as there is nothing to switch to. How can I configure 
> > nagios not to execute event hanlder when some service check or host
> > check has failed?
> > Thanks in advance.
> > --
> >  mit.
> >
> >   
> When you configure the service , you define event handlers , you can 
> create a service definition for each host and service , so you can 
> exclude any host or service from running the event handler .
> 
> example :
> define service {
>   hostgroups WEB
>   host_name !web1 , !web2
>   ...
>   eventhandler   change_dns
> }
> 
> 
> this will cause the service and event handler to work on all hosts in 
> the WEB hostgroup excluding the web1 and web2 servers.
> 
> hope this helps .
> 
> Assaf
> 
> --
> Xperia(TM) PLAY
> It's a major breakthrough. An authentic gaming
> smartphone on the nation's most reliable network.
> And it wants your games.
> http://p.sf.net/sfu/verizon-sfdev
> ___
> 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


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
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] Service failover dependency

2011-04-07 Thread Assaf Flatto
Andrey Mitroshin wrote:
> Hello,
>   
>  
> I'm about to implement simple failover scenario with nagios. It consists of
> host A, host B and nagios host. When host A is down nagios executes
> event handler which performs dynamic dns update on some hostname to
> point it to host B. But when host B is down, nagios should not execute
> event handler as there is nothing to switch to. How can I configure 
> nagios not to execute event hanlder when some service check or host
> check has failed?
> Thanks in advance.
> --
>  mit.
>
>   
When you configure the service , you define event handlers , you can 
create a service definition for each host and service , so you can 
exclude any host or service from running the event handler .

example :
define service {
  hostgroups WEB
  host_name !web1 , !web2
  ...
  eventhandler   change_dns
}


this will cause the service and event handler to work on all hosts in 
the WEB hostgroup excluding the web1 and web2 servers.

hope this helps .

Assaf

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
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] Service failover dependency

2011-04-07 Thread Andrey Mitroshin
Hello,  
 
I'm about to implement simple failover scenario with nagios. It consists of
host A, host B and nagios host. When host A is down nagios executes
event handler which performs dynamic dns update on some hostname to
point it to host B. But when host B is down, nagios should not execute
event handler as there is nothing to switch to. How can I configure 
nagios not to execute event hanlder when some service check or host
check has failed?
Thanks in advance.
--
 mit.


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
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