Skip to content

Commit

Permalink
Update monit docs and update changelog/readme
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored and idohalevi committed Sep 23, 2020
1 parent db04927 commit abcd6d3
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 143 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#### New Inputs

- [infiniband](/plugins/inputs/infiniband/README.md) - Contributed by @willfurnell
- [monit](/plugins/inputs/monit/README.md) - Contributed by @SirishaGopigiri

#### New Outputs

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ For documentation on the latest development code see the [documentation index][d
* [mesos](./plugins/inputs/mesos)
* [minecraft](./plugins/inputs/minecraft)
* [mongodb](./plugins/inputs/mongodb)
* [monit](./plugins/inputs/monit)
* [mqtt_consumer](./plugins/inputs/mqtt_consumer)
* [multifile](./plugins/inputs/multifile)
* [mysql](./plugins/inputs/mysql)
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/EXAMPLE_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mapped to the output.
- field1 (type, unit)
- field2 (float, percent)

- measurement2
+ measurement2
- tags:
- tag3
- fields:
Expand Down
363 changes: 225 additions & 138 deletions plugins/inputs/monit/README.md
Original file line number Diff line number Diff line change
@@ -1,148 +1,235 @@
# Monit Plugin
# Monit Input Plugin

The monit plugin gathers metrics and status information about local processes,
remote hosts, file, file systems, directories and network interfaces managed and watched over by Monit.
The `monit` plugin gathers metrics and status information about local processes,
remote hosts, file, file systems, directories and network interfaces managed
and watched over by [Monit][monit].

To install Monit agent on the host please refer to the link https://mmonit.com/wiki/Monit/Installation
The use this plugin you should first enable the [HTTPD TCP port][httpd] in
Monit.

Minimum Version of Monit tested with is 5.16
Minimum Version of Monit tested with is 5.16.

### Configuration:
[monit]: https://mmonit.com/
[httpd]: https://mmonit.com/monit/documentation/monit.html#TCP-PORT

### Configuration

```toml
# Read metrics and status information about processes managed by Monit
[[inputs.monit]]
#SampleConfig
address = "http://127.0.0.1:2812"
basic_auth_username = "test"
basic_auth_password = "test"
[[inputs.monit]]
## Monit HTTPD address
address = "http://127.0.0.1:2812"

## Username and Password for Monit
# username = ""
# password = ""

## Amount of time allowed to complete the HTTP request
# timeout = "5s"

## Optional TLS Config
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
## Use TLS but skip chain & host verification
# insecure_skip_verify = false
```

### Tags:
All measurements have the following tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode

### Measurements & Fields:

<optional description>

### Fields:
Fields for all Monit service types:
- status_code
- monitoring_status_code
- monitoring_mode_code

### Measurement & Fields:
Fields for Monit service type Filesystem:
- Measurement:
- monit_filesystem
- Fields:
- mode
- block_percent
- block_usage
- block_total
- inode_percent
- inode_usage
- inode_total

Fields for Monit service type directory:
- Measurement:
- monit_directory
- Fields:
- permissions

Fields for Monit service type file:
- Measurement:
- monit_file
- Fields:
- size
- permissions

Fields for Monit service type process:
- Measurement:
- monit_process
- Fields:
- cpu_percent
- cpu_percent_total
- mem_kb
- mem_kb_total
- mem_percent
- mem_percent_total
- pid
- parent_pid
- threads
- children

Fields for Monit service type remote host:
- Measurement:
- monit_remote_host
- Fields:
- hostname
- port_number
- request
- protocol
- type

Fields for Monit service type system:
- Measurement:
- monit_system
- Fields:
- cpu_system
- cpu_user
- cpu_wait
- cpu_load_avg_1m
- cpu_load_avg_5m
- cpu_load_avg_15m
- mem_kb
- mem_percent
- swap_kb
- swap_percent

Fields for Monit service type fifo:
- Measurement:
- monit_fifo
- Fields:
- permissions

Fields for Monit service type program:
- Measurement:
- monit_program
- Fields:
- last_started_time
- program_status

Fields for Monit service type network:
- Measurement:
- monit_network
- Fields:
- link_state
- link_mode
- link_speed
- download_packets_now
- download_packets_total
- download_bytes_now
- download_bytes_total
- download_errors_now
- download_errors_total
- upload_packets_now
- upload_packets_total
- upload_bytes_now
- upload_bytes_total
- upload_errors_now
- upload_errors_total

### Example Output:
### Metrics

- monit_filesystem
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code
- mode
- block_percent
- block_usage
- block_total
- inode_percent
- inode_usage
- inode_total

+ monit_directory
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code
- permissions

- monit_file
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code
- size
- permissions

+ monit_process
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code
- cpu_percent
- cpu_percent_total
- mem_kb
- mem_kb_total
- mem_percent
- mem_percent_total
- pid
- parent_pid
- threads
- children

- monit_remote_host
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code
- hostname
- port_number
- request
- protocol
- type

+ monit_system
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code
- cpu_system
- cpu_user
- cpu_wait
- cpu_load_avg_1m
- cpu_load_avg_5m
- cpu_load_avg_15m
- mem_kb
- mem_percent
- swap_kb
- swap_percent

- monit_fifo
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code
- permissions

+ monit_program
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code

- monit_network
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code

+ monit_program
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code

- monit_network
- tags:
- address
- version
- service
- paltform_name
- status
- monitoring_status
- monitoring_mode
- fields:
- status_code
- monitoring_status_code
- monitoring_mode_code

### Example Output
```
$ ./telegraf -config telegraf.conf -input-filter monit -test
monit_system,address=http://localhost:2812,host=verizon-onap,hostname=verizon-onap,monitoring_mode=Monitoring\ mode:\ \ active,monitoring_status=Monitoring\ status:\ \ Monitored,platform_name=Linux,service=verizon-onap,status=Running,version=5.16 status_code=0i,cpu_system=1.9,cpu_user=4.7,cpu_wait=1.5,cpu_load_avg_1m=1.24,cpu_load_avg_5m=1.68,mem_percent=67.1,monitoring_status_code=1i,monitoring_mode_code=0i,cpu_load_avg_15m=1.64,mem_kb=10961012i,swap_kb=2322688,swap_percent=13.9 1578636430000000000
monit_remote_host,address=http://localhost:2812,host=verizon-onap,hostname=verizon-onap,monitoring_mode=Monitoring\ mode:\ \ passive,monitoring_status=Monitoring\ status:\ \ Monitored,platform_name=Linux,service=testing,status=Failure,version=5.16 status_code=32i,monitoring_status_code=1i,monitoring_mode_code=1i,remote_hostname="192.168.10.49",port_number=2220i,request="",protocol="DEFAULT",type="TCP" 1578636430000000000
monit_fifo,address=http://localhost:2812,host=verizon-onap,hostname=verizon-onap,monitoring_mode=Monitoring\ mode:\ \ active,monitoring_status=Monitoring\ status:\ \ Monitored,platform_name=Linux,service=test2,status=Running,version=5.16 status_code=0i,monitoring_status_code=1i,monitoring_mode_code=0i,permissions=664i 1578636430000000000
monit_network,address=http://localhost:2812,host=verizon-onap,hostname=verizon-onap,monitoring_mode=Monitoring\ mode:\ \ active,monitoring_status=Monitoring\ status:\ \ Monitored,platform_name=Linux,service=test1,status=Failure,version=5.16 monitoring_status_code=1i,monitoring_mode_code=0i,download_packets_total=0i,upload_bytes_now=0i,download_errors_total=0i,status_code=8388608i,link_speed=-1i,link_mode="Unknown Mode",download_bytes_now=0i,download_bytes_total=0i,download_errors_now=0i,upload_packets_total=0i,upload_bytes_total=0i,upload_errors_now=0i,upload_errors_total=0i,link_state=0i,download_packets_now=0i,upload_packets_now=0i 1578636430000000000
monit_directory,address=http://localhost:2812,host=verizon-onap,hostname=verizon-onap,monitoring_mode=Monitoring\ mode:\ \ passive,monitoring_status=Monitoring\ status:\ \ Monitored,platform_name=Linux,service=test,status=Running,version=5.16 status_code=0i,monitoring_status_code=1i,monitoring_mode_code=1i,permissions=755i 1578636430000000000
monit_file,monitoring_mode=active,monitoring_status=monitored,pending_action=none,platform_name=Linux,service=rsyslog_pid,source=xyzzy.local,status=running,version=5.20.0 mode=644i,monitoring_mode_code=0i,monitoring_status_code=1i,pending_action_code=0i,size=3i,status_code=0i 1579735047000000000
monit_process,monitoring_mode=active,monitoring_status=monitored,pending_action=none,platform_name=Linux,service=rsyslog,source=xyzzy.local,status=running,version=5.20.0 children=0i,cpu_percent=0,cpu_percent_total=0,mem_kb=3148i,mem_kb_total=3148i,mem_percent=0.2,mem_percent_total=0.2,monitoring_mode_code=0i,monitoring_status_code=1i,parent_pid=1i,pending_action_code=0i,pid=318i,status_code=0i,threads=4i 1579735047000000000
monit_program,monitoring_mode=active,monitoring_status=initializing,pending_action=none,platform_name=Linux,service=echo,source=xyzzy.local,status=running,version=5.20.0 monitoring_mode_code=0i,monitoring_status_code=2i,pending_action_code=0i,program_started=0i,program_status=0i,status_code=0i 1579735047000000000
monit_system,monitoring_mode=active,monitoring_status=monitored,pending_action=none,platform_name=Linux,service=debian-stretch-monit.virt,source=xyzzy.local,status=running,version=5.20.0 cpu_load_avg_15m=0,cpu_load_avg_1m=0,cpu_load_avg_5m=0,cpu_system=0,cpu_user=0,cpu_wait=0,mem_kb=42852i,mem_percent=2.1,monitoring_mode_code=0i,monitoring_status_code=1i,pending_action_code=0i,status_code=0i,swap_kb=0,swap_percent=0 1579735047000000000
```
Loading

0 comments on commit abcd6d3

Please sign in to comment.