GithubHelp home page GithubHelp logo

fping_exporter's People

Contributors

dependabot[bot] avatar kiskae avatar

Watchers

 avatar  avatar  avatar

fping_exporter's Issues

Include helper script that runs fping in docker to test different versions

fping.sh:

#!/usr/bin/env bash
SCRIPT_PATH="`dirname \"$0\"`"
docker stop fping_proxy > /dev/null 2>&1
docker rm fping_proxy > /dev/null 2>&1
exec docker run --name fping_proxy --stop-signal SIGKILL $(docker build -q $SCRIPT_PATH) "$@"

Dockerfile:

ARG FPING_VERSION="5.0"

FROM buildpack-deps:buster as fping_builder
WORKDIR /usr/src/fping
RUN apt-get update && apt-get install -y \
  musl-tools \
  && rm -rf /var/lib/apt/lists/*
ARG FPING_VERSION
RUN curl https://fping.org/dist/fping-${FPING_VERSION}.tar.gz | tar -xz --strip-components=1
RUN CC=musl-gcc ./configure LDFLAGS=-static && make && make install

FROM scratch
COPY --from=fping_builder /usr/local/sbin/fping /bin/
ENTRYPOINT [ "/bin/fping" ]

Replace program timeout with internal fping re-exec

instead of putting a timeout on the entire application, turn the fping listener into a loop which has the option of periodically re-executing the fping process. This will allow for continuity of the data while also allowing an optional refresh of fping targets.

Apply EventStream wrappers based on type system matching

Example snippet:

trait ValidControl<F: EventHandler> {
    type WrappedHandler: EventHandler;

    fn wrap(handler: F) -> Self::WrappedHandler;
}

enum Disabled {}

impl<F: EventHandler> ValidControl<F> for Disabled {
    type WrappedHandler = F;

    fn wrap(handler: F) -> Self::WrappedHandler {
        handler
    }
}

struct Enabled<T> {
    _marker: PhantomData<T>,
}

impl<F, T: std::fmt::Debug> ValidControl<F> for Enabled<oneshot::Sender<T>>
where
    F: EventHandler<Token = Interrupted<(oneshot::Sender<T>, Claim)>>,
    F::Handle: util::signal::Interruptable<Signal = nix::sys::signal::Signal> + std::fmt::Debug,
{
    type WrappedHandler =
        NoPrelaunchControl<LockControl<ControlToInterrupt<F, nix::sys::signal::Signal>>>;

    fn wrap(handler: F) -> Self::WrappedHandler {
        NoPrelaunchControl::new(LockControl::new(ControlToInterrupt::new(
            handler,
            <F::Handle as Interruptable>::Signal::sigquit(),
        )))
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.