Sign inSign up

alvarobrandon/fmone-agent

By alvarobrandon

•Updated over 8 years ago

A lightweight and customisable monitor agent designed for a Fog environment

Image
0

50K+

alvarobrandon/fmone-agent repository overview

The image is built on top of the lightweight alpine Linux image. The FMonE agent is written in python and the code is accesible in https://github.com/Brandonage/fmone⁠.

To launch the agent the parameters are

docker run -v /var/run/docker.sock:/var/run/docker.sock fmone-agent xcollect xpublish inplugin midplugin outplugin [--additional_parameters]

where:

  • xcollect: Is the monitoring period in seconds in which the inplugin should collect metrics

  • xpublish: Is the publish period in seconds in which the outplugin should push the metrics

  • inplugin: is the plugin that the agent will use to ingest metrics. There are several available at this moment:

    • host: CPU, memory, disk and network metrics of the machine hosting the container. In the case of UNIX these are extracted from the/proc directory
    • docker: CPU, memory, disk and network metrics of the container itself. These are extracted from the /var/run/docker.sock that streams, among other things, stats about the containers.
    • rabbitmq: It extracts metrics that have been previously published by other Fmone agents to a RabbitMQ server with a routing key. It needs the following additional parameters
      • mq_machine_in: The RabbitMQ server to connect to
      • routing_key_in: The routing key from which we want to read the messages
    • kakfa: It extracts metrics that have been previously published by other Fmone agents to a Kafkatopic. The user can choose this messaging service over RabbitMQ when the amount of metrics needs a more scalable solution
      • kafka_bootstrap_in: The Kafka bootstrap server to connect to
      • kafka_topic_in: The topic from which we wat to read the messages
  • midplugin: the responsibility of this plugin is to filter and aggregate the metrics collected by the InPlugin. The different options are:

    • inout: It just passes the metrics from the InPlugin to the OutPlugin without any preprocessing.
    • average: It averages all the metrics that have been collected by the agent between the publish intervals defined by the xpublish parameter
  • outplugin: Its responsability is to push the metrics to an available backend.

    • file: It stores all the metrics in a file. Useful for post mortem analysis of systems. It needs one parameter.
      • outfilepath: The path inside the filesystem where the metrics are going to be dumped into
    • console: It prints all the metrics to the stdout of the process
    • rabbitmq: It pushes the metrics of the agent to a RabbitMQ server with a routing key. It needs the following parameters
      • mq_machine_out: The RabbitMQ server to connect to
      • routing_key_out: The routing key to which we want to push the messages
    • kafka: It pushes the metrics of the agent to a Kafka topic. The user can choose this messaging service over RabbitMQ when the amount of metrics requires a more scalable solution. It needs the following parameters:
      • kafka_bootstrap_out: The Kafka bootstrap server to connect to
      • kafka_topic_out: The topic to which we want to push the messages
    • mongodb: It stores the metrics in a MongoDB backend. This is useful when the user wants to extract summaries and build dashboards with the metrics. It needs the following parameters.
      • mongo_machine_out: The MongoDB server to connect to
      • mongo_collection_out: The MongoDB collection where we want to store the metrics

Some examples of launching containers are:

  • The simplest form. Monitor the metrics of the host and print them through the console. Note that we do not need any additional parameters: docker run -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/proc_host fmone-agent 1 1 host inout console

  • Monitor every second the docker containers running on the host, don't filter the metrics and publish them to a RabbitMQ container that has a hostname "my-rabbit" with a routing key "region"
    docker run -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/proc_host fmone-agent 1 1 docker inout rabbitmq --mq_machine_out my-rabbit:5672 --routing_key_out region

  • Pull out every second the metrics from the RabbitMQ container and calculate the average plus store it in a MongoDB in collection regionmetrics every 5 seconds: docker run -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/proc_host alvarobrandon/fmone-agent 1 5 rabbitmq average mongodb --mq_machine_in my-rabbit:5672 --routing_key_in regional --mongo_machine_out my-mongo --mongo_collection_out regionmetrics

Tag summary

Content type

Image

Digest

Size

28.6 MB

Last updated

over 8 years ago

docker pull alvarobrandon/fmone-agent