Re: [Nagios-users] "distributable" downtime delete commands?

2013-02-12 Thread Andreas Ericsson
On 02/12/2013 05:24 AM, Páll Guðjón Sigurðsson wrote:
> Thanks for the sed Andreas,
> 
> If anyone on the list is interested i compared include.common.h from 
> nagios-3.4.4 with the documentation at  
> http://www.nagios.org/developerinfo/externalcommands/ and discovered the 
> following discrepancies:
> 
> External commands that are documented but not found in the source code:
> DISABLE_SERVICE_FLAP_DETECTION

This is in reality 'DISABLE_SVC_FLAP_DETECTION'

> RESTART_PROGRAM
> SHUTDOWN_PROGRAM
> 

These are 'RESTART_PROCESS' and 'SHUTDOWN_PROCESS', respectively.

> 
> External commands that appear undocumented:
> NONE

This is an error marker for internal use only and shouldn't be
documented at all.

> DELAY_HOST_SVC_NOTIFICATIONS

This is currently unimplemented.

> CANCEL_HOST_DOWNTIME
> CANCEL_SVC_DOWNTIME
> CANCEL_ACTIVE_HOST_DOWNTIME
> CANCEL_PENDING_HOST_DOWNTIME
> CANCEL_ACTIVE_SVC_DOWNTIME
> CANCEL_PENDING_SVC_DOWNTIME
> CANCEL_ACTIVE_HOST_SVC_DOWNTIME
> CANCEL_PENDING_HOST_SVC_DOWNTIME

These are unimplemented, as documented by comments in include/common.h

A command overhaul in time for 4.1 would be a good idea. Using a hash-
table to look up the command and its handler would be a very good idea
indeed. Then we'd do the "insert to hash-table" thing as
add_command(char *name, char *description, int (*handler)(char *cmd, char 
*args))

or some such and generate the help-list from that, while allowing nebs
to access the same command parsing routines as the rest of Nagios.

Though to be honest, I'd much rather just extend the query handler thing
and let commands take key/value vectors via the socket. That way we can
support multiline values properly and get rid of nonsensical attributes.

> FLUSH_PENDING_COMMANDS

This has no meaning anymore, and if I guess correctly it never had, as
it would be impossible to submit a command that flushes all pending
commands, as any command one want to flush are either already parsed
and processed when we get to this command, or hasn't been picked up
by the command queue yet (in Nagios 3 that is; In Nagios 4 it has
absolutely zero meaning).

I'll remove this.

> CHANGE_HOST_NOTIFICATION_TIMEPERIOD

This is undocumented for real, although its meaning should be fairly
self-explanatory.

> DEL_DOWNTIME_BY_HOST_NAME
> DEL_DOWNTIME_BY_HOSTGROUP_NAME
> DEL_DOWNTIME_BY_START_TIME_COMMENT

These are the new 'distributable' downtime delete commands, which I
suppose are undocumented.

> CUSTOM_COMMAND
> 

This is currently unused, to the best of my knowledge. Its intended
use is for eventbroker modules that want to accept external commands.
There can't really be any documentation for it, apart from whatever
the module itself decides to accept as input.

Since the query handler got implemented (which allows for feedback from
the targeted handler), this should be considered obsolete.

> I totally agree with Andreas, that it would be nice if there was a
> handler that could print commands, short description, and in an
> utopian world, the documentation would be generated from that so there
> is no need to maintain it manually.
> 

Well, it still needs to be maintained manually, since the description
and the command template isn't going to write itself. It would just be
a lot more up to date if the documentation was kept inline with the
code.

-- 
Andreas Ericsson   andreas.erics...@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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] "distributable" downtime delete commands?

2013-02-11 Thread Páll Guðjón Sigurðsson
Thanks for the sed Andreas,

If anyone on the list is interested i compared include.common.h from 
nagios-3.4.4 with the documentation at  
http://www.nagios.org/developerinfo/externalcommands/ and discovered the 
following discrepancies:

External commands that are documented but not found in the source code:
DISABLE_SERVICE_FLAP_DETECTION
RESTART_PROGRAM
SHUTDOWN_PROGRAM


External commands that appear undocumented:
NONE
RESTART_PROCESS
SHUTDOWN_PROCESS
DELAY_HOST_SVC_NOTIFICATIONS
CANCEL_HOST_DOWNTIME
CANCEL_SVC_DOWNTIME
CANCEL_ACTIVE_HOST_DOWNTIME
CANCEL_PENDING_HOST_DOWNTIME
CANCEL_ACTIVE_SVC_DOWNTIME
CANCEL_PENDING_SVC_DOWNTIME
CANCEL_ACTIVE_HOST_SVC_DOWNTIME
CANCEL_PENDING_HOST_SVC_DOWNTIME
FLUSH_PENDING_COMMANDS
CHANGE_HOST_NOTIFICATION_TIMEPERIOD
DEL_DOWNTIME_BY_HOST_NAME
DEL_DOWNTIME_BY_HOSTGROUP_NAME
DEL_DOWNTIME_BY_START_TIME_COMMENT
CUSTOM_COMMAND

I totally agree with Andreas, that it would be nice if there was a handler that 
could print commands, short description, and in an utopian world, the 
documentation would be generated from that so there is no need to maintain it 
manually.


Cheers,
Palli

- Original Message -
From: "Andreas Ericsson" 
To: "Nagios Users List" 
Cc: "Páll Guðjón Sigurðsson" , "Nagios Developers List" 

Sent: Saturday, February 9, 2013 5:48:29 PM
Subject: Re: [Nagios-users] "distributable" downtime delete commands?

On 02/08/2013 04:32 AM, Páll Guðjón Sigurðsson wrote:
> Thanks a lot Paul,
> 
> We have been achieving the same goals with pynag scripts and
> DEL_SVC_DOWNTIME command.
> 
> Is there anyone on the list that might take it into their hands to
> keep documentation up to date, maybe even write a routine in nagios
> to ask for every supported external command, so that external scripts
> know what external commands are supported ?
> 

It wouldn't be hard to build a command query-handler in Nagios that
can list the available commands, along with a short description saying
what it does. The same could be used with macros and other things we
already have pre-compiled lists of.

I've been meaning to write one that can handle external commands from
users and reply with a result code to let people know how it actually
went parsing, understanding and applying it anyway, so it'll get done
eventually. Right now I'm working on something different though.

> The pynag team depends on the documentation to generate library
> functions, but we have found a few glitches in both external commands
> docs and the nagios.cfg docs. Anyone willing to help us on "getting
> it right" deserves a beer.
> 

Use the code instead. The external commands are all listed in
include/common.h, so

sed -n 's/^#define CMD_\([A-Z_]*\).*/\1/p'

will list all of them (although some of them are disabled internally,
so you'll have to keep a list of those).

-- 
Andreas Ericsson   andreas.erics...@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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] "distributable" downtime delete commands?

2013-02-11 Thread Paul Dubuc
Páll Guðjón Sigurðsson wrote:
> Thanks a lot Paul,
>
> We have been achieving the same goals with pynag scripts and
> DEL_SVC_DOWNTIME command.
>
> Is there anyone on the list that might take it into their hands to keep
> documentation up to date, maybe even write a routine in nagios to ask for
> every supported external command, so that external scripts know what
> external commands are supported ?
>
> The pynag team depends on the documentation to generate library functions,
> but we have found a few glitches in both external commands docs and the
> nagios.cfg docs. Anyone willing to help us on "getting it right" deserves a
> beer.
>
> Kind regards, Pall Sigurdsson

In my humble opinion, it is incumbent upon those who add new features to 
provide documentation for them.  I was happy to help here, since I needed to 
know how these worked myself (and since I'm fluent in C).  As Andreas pointed 
out, it's easy to grep the source code to find the external command names, but 
that is only the beginning in figuring out how the commands actually work.

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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] "distributable" downtime delete commands?

2013-02-09 Thread Andreas Ericsson
On 02/08/2013 04:32 AM, Páll Guðjón Sigurðsson wrote:
> Thanks a lot Paul,
> 
> We have been achieving the same goals with pynag scripts and
> DEL_SVC_DOWNTIME command.
> 
> Is there anyone on the list that might take it into their hands to
> keep documentation up to date, maybe even write a routine in nagios
> to ask for every supported external command, so that external scripts
> know what external commands are supported ?
> 

It wouldn't be hard to build a command query-handler in Nagios that
can list the available commands, along with a short description saying
what it does. The same could be used with macros and other things we
already have pre-compiled lists of.

I've been meaning to write one that can handle external commands from
users and reply with a result code to let people know how it actually
went parsing, understanding and applying it anyway, so it'll get done
eventually. Right now I'm working on something different though.

> The pynag team depends on the documentation to generate library
> functions, but we have found a few glitches in both external commands
> docs and the nagios.cfg docs. Anyone willing to help us on "getting
> it right" deserves a beer.
> 

Use the code instead. The external commands are all listed in
include/common.h, so

sed -n 's/^#define CMD_\([A-Z_]*\).*/\1/p'

will list all of them (although some of them are disabled internally,
so you'll have to keep a list of those).

-- 
Andreas Ericsson   andreas.erics...@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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] "distributable" downtime delete commands?

2013-02-07 Thread Páll Guðjón Sigurðsson
Thanks a lot Paul,

We have been achieving the same goals with pynag scripts and DEL_SVC_DOWNTIME 
command.

Is there anyone on the list that might take it into their hands to keep 
documentation up to date, maybe even write a routine in nagios to ask for every 
supported external command, so that external scripts know what external 
commands are supported ?

The pynag team depends on the documentation to generate library functions, but 
we have found a few glitches in both external commands docs and the nagios.cfg 
docs. Anyone willing to help us on "getting it right" deserves a beer.

Kind regards,
Pall Sigurdsson





- Original Message -
From: "Paul Dubuc" 
To: "Nagios Users List" 
Cc: "Nagios Developers List" 
Sent: Wednesday, February 6, 2013 8:50:05 PM
Subject: Re: [Nagios-users] "distributable" downtime delete commands?

Paul Dubuc wrote:
> Among the enhancements listed for Nagios 3.3.1:
>
> 3.3.1. - 07/25/2011 ENHANCEMENTS
>
> * Downtime delete commands made "distributable" by deleting by host group
> name, host name or start time/comment (Opsview team)
>
> Where are these commands documented?  I don't see them in the online
> documentation:
>
> http://old.nagios.org/developerinfo/externalcommands/commandlist.php?category_id=6&version_id=0&btnSubmit=Update
>
>  only lists delete commands that require a downtime ID.
>

For anyone else who's interested, here are the external command formats for
these new commands. They're very handy for automating downtime deletion since 
downtime IDs are hard to obtain for that purpose. Values in in brackets are 
optional and serve to make filtering more specific:


DEL_DOWNTIME_BY_HOSTGROUP_NAME;;[];[];[];[]

DEL_DOWNTIME_BY_HOST_NAME;;[];[];[]

DEL_DOWNTIME_BY_START_TIME_COMMENT;;[]

DEL_DOWNTIME_BY_START_TIME_COMMENT;


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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

--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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] "distributable" downtime delete commands?

2013-02-06 Thread Paul Dubuc
Paul Dubuc wrote:
> Paul Dubuc wrote:
>> Among the enhancements listed for Nagios 3.3.1:
>>
>> 3.3.1. - 07/25/2011 ENHANCEMENTS
>>
>> * Downtime delete commands made "distributable" by deleting by host group
>> name, host name or start time/comment (Opsview team)
>>
>> Where are these commands documented?  I don't see them in the online
>> documentation:
>>
>> http://old.nagios.org/developerinfo/externalcommands/commandlist.php?category_id=6&version_id=0&btnSubmit=Update
>>
>>   only lists delete commands that require a downtime ID.
>>
>
> For anyone else who's interested, here are the external command formats for
> these new commands. They're very handy for automating downtime deletion since
> downtime IDs are hard to obtain for that purpose. Values in in brackets are
> optional and serve to make filtering more specific:
>
>
> DEL_DOWNTIME_BY_HOSTGROUP_NAME;;[];[];[];[]
>
> DEL_DOWNTIME_BY_HOST_NAME;;[];[];[]
>
> DEL_DOWNTIME_BY_START_TIME_COMMENT;;[]
>
> DEL_DOWNTIME_BY_START_TIME_COMMENT;

This last one should be:

DEL_DOWNTIME_BY_START_TIME_COMMENT;;

You must have either a , or a , or both with 
DEL_DOWNTIME_BY_START_TIME_COMMENT.



--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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] "distributable" downtime delete commands?

2013-02-06 Thread Paul Dubuc
Paul Dubuc wrote:
> Among the enhancements listed for Nagios 3.3.1:
>
> 3.3.1. - 07/25/2011 ENHANCEMENTS
>
> * Downtime delete commands made "distributable" by deleting by host group
> name, host name or start time/comment (Opsview team)
>
> Where are these commands documented?  I don't see them in the online
> documentation:
>
> http://old.nagios.org/developerinfo/externalcommands/commandlist.php?category_id=6&version_id=0&btnSubmit=Update
>
>  only lists delete commands that require a downtime ID.
>

For anyone else who's interested, here are the external command formats for
these new commands. They're very handy for automating downtime deletion since 
downtime IDs are hard to obtain for that purpose. Values in in brackets are 
optional and serve to make filtering more specific:


DEL_DOWNTIME_BY_HOSTGROUP_NAME;;[];[];[];[]

DEL_DOWNTIME_BY_HOST_NAME;;[];[];[]

DEL_DOWNTIME_BY_START_TIME_COMMENT;;[]

DEL_DOWNTIME_BY_START_TIME_COMMENT;


--
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
___
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] "distributable" downtime delete commands?

2013-01-31 Thread Paul Dubuc
Among the enhancements listed for Nagios 3.3.1:

3.3.1. - 07/25/2011
ENHANCEMENTS

* Downtime delete commands made "distributable" by deleting
 by host group name, host name or start time/comment (Opsview team)

Where are these commands documented?  I don't see them in the online 
documentation:

http://old.nagios.org/developerinfo/externalcommands/commandlist.php?category_id=6&version_id=0&btnSubmit=Update

only lists delete commands that require a downtime ID.

--
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_jan
___
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