Skip to content
This repository has been archived by the owner on Jan 15, 2019. It is now read-only.

[dev.icinga.com #2903] add runcmd and worker libraries to libicinga #1039

Closed
icinga-migration opened this issue Jul 26, 2012 · 4 comments
Closed
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/2903

Created by mfriedrich on 2012-07-26 18:19:18 +00:00

Assignee: mfriedrich
Status: Closed (closed on 2012-08-22 18:19:26 +00:00)
Target Version: exp
Last Update: 2012-08-22 18:19:26 +00:00 (in Redmine)


actually, the worker library isn't really a library, but shows some good examples how to use the api on spawning workers (remotely). other than that, it contains the on-top-implementation of kvvec, squeue, iocache and iobroker, merging the functionality together.

besides that, runcmd.c/.h is taken from the nagios plugins project, and might need some enhancements in the future. we might use a different implementation, but keep the apis intact.

this is experimental, and should only live in dev/* stages. further discussions what to happen. original author - Andreas Ericsson.

Changesets

2012-07-26 18:40:59 +00:00 by mfriedrich 9e586b1f9bd123ae50e82bb4b1e988e8f96a5d55

libicinga: add runcmd and worker libraries #2903

bound together using

* squeue/pqueue (creating a worker local scheduling queue = jobs queue)

- enter_worker (squeue_create, squeue_peek for timeouts)
- spawn_job (squeue_add)
- finish_job (squeue_remove)

* kvvec (logical key/value arrays to be worked on by job_ids and such)

keys:
- job_id
- command
- timeout
- error_msg
- outstd
- outerr
- start
- stop
- ru_utime
- ru_stime
- ru_minflt
- ru_majflt
- ru_nswap
- ru_inblock
- ru_oublock
- ru_nsignals

* iocache (receiving commands, on worker spawn)

- receive_command (iocache_create, iocache_read, io_cache_use_delim)
- spawn_worker (iocache_create)

* iobroker (polling fds to receive jobs/commands between workers)

- enter_worker (iobroker_create, iobroker_register (master_fd,
  receive_command), iobroker_get_num_fds, iobroker_poll)
- worker_process (iobroker_max_usable_fds)
- fd_start_cmd (iobroker_register - stdout, stderr)
- receive_command (iobroker_close)
- finish_job (iobroker_close)
- gather_output (iobroker_close)

this adds the library code for the workers, to be used as an example for
polling the api, and also for the local workers which could be
implemented in the future.

furthermore, this adds runcmd inherited from nagios plugins project,
where Andreas Ericsson is the author as well. It uses a safe popen
implementation, which does not fork into a shell, lightweight execve so
to speak. we might adopt that in the future for performance, but keeping
the apis intact.

refs #2903

2012-07-26 18:53:26 +00:00 by mfriedrich 3ae5a0a624b08c77c7d5eddc3830d5a790e59326

libicinga: add the wproc example using worker library

refs #2903

Relations:

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-07-26 18:42:51 +00:00

additionally, add the wproc example as well.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-07-26 20:46:30 +00:00

rusage kvvec values - http://www.delorie.com/gnu/docs/glibc/libc\_447.html

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-08-07 16:50:12 +00:00

  • Target Version set to exp

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2012-08-22 18:19:26 +00:00

  • Status changed from Assigned to Closed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant