Re: [Nagios-devel] [Nagios-users] "distributable" downtime delete

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

Re: [Nagios-devel] [Nagios-users] "distributable" downtime delete

Post by Guest »

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/ext ... mit=Update
>
> only lists delete commands that require a downtime ID.

OK, so these are apparently not documented anywhere except the source code.
I'm reading it to figure out how this works and I'm puzzled by the following
code in cmd_delete_downtime_by_hostgroup_name() in base/commands.c (version
3.4.4 source):


> /* get the optional host name */
> temp_ptr = my_strtok(NULL, ";");
> if(temp_ptr != NULL) {
> if(*temp_ptr != '\0')
> host_name = temp_ptr;
>
> /* get the optional service name */
> temp_ptr = my_strtok(NULL, ";");
> if(temp_ptr != NULL) {
> if(*temp_ptr != '\0')
> service_description = temp_ptr;
>
> /* get the optional start time */
> temp_ptr = my_strtok(NULL, ";");
> if(temp_ptr != NULL) {
> downtime_start_time = strtoul(temp_ptr, &end_ptr, 10);
>
> /* get the optional comment */
> temp_ptr = my_strtok(NULL, ";");
> if(temp_ptr != NULL) {
> if(*temp_ptr != '\0')
> downtime_comment = temp_ptr;
>
> }
> }
> }
>
> /* get the optional service name */
> temp_ptr = my_strtok(NULL, ";");
> if(temp_ptr != NULL) {
> if(*temp_ptr != '\0')
> service_description = temp_ptr;
>
> /* get the optional start time */
> temp_ptr = my_strtok(NULL, ";");
> if(temp_ptr != NULL) {
> downtime_start_time = strtoul(temp_ptr, &end_ptr, 10);
>
> /* get the optional comment */
> temp_ptr = my_strtok(NULL, ";");
> if(temp_ptr != NULL) {
> if(*temp_ptr != '\0')
> downtime_comment = temp_ptr;
> }
> }
> }
> }

Am I missing something, or is there an unnecessary duplication of the "get the
optional service name" code block here?





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: work@paul.dubuc.org
Locked