]> arthur.barton.de Git - netdata.git/commitdiff
Merge pull request #1928 from ktsaou/master
authorCosta Tsaousis <costa@tsaousis.gr>
Sat, 11 Mar 2017 10:38:37 +0000 (12:38 +0200)
committerGitHub <noreply@github.com>
Sat, 11 Mar 2017 10:38:37 +0000 (12:38 +0200)
add common version options to all C programs

README.md
src/apps_plugin.c
src/freeipmi_plugin.c
src/main.c

index 240ab32be600590da0c7072e5da0076b261595f0..3d73b9ecce452c2a9c340e71990c5014501f133a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# netdata [![Build Status](https://travis-ci.org/firehol/netdata.svg?branch=master)](https://travis-ci.org/firehol/netdata) [![Coverity Scan Build Status](https://scan.coverity.com/projects/9140/badge.svg)](https://scan.coverity.com/projects/firehol-netdata) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a994873f30d045b9b4b83606c3eb3498)](https://www.codacy.com/app/netdata/netdata?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=firehol/netdata&amp;utm_campaign=Badge_Grade) [![Code Climate](https://codeclimate.com/github/firehol/netdata/badges/gpa.svg)](https://codeclimate.com/github/firehol/netdata) [![Docker Pulls](https://img.shields.io/docker/pulls/titpetric/netdata.svg)](https://hub.docker.com/r/titpetric/netdata/) [![Twitter Follow](https://img.shields.io/twitter/follow/linuxnetdata.svg?style=social&label=netdata%20on%20twitter)](https://twitter.com/linuxnetdata)
+# netdata [![Build Status](https://travis-ci.org/firehol/netdata.svg?branch=master)](https://travis-ci.org/firehol/netdata) [![Coverity Scan Build Status](https://scan.coverity.com/projects/9140/badge.svg)](https://scan.coverity.com/projects/firehol-netdata) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/a994873f30d045b9b4b83606c3eb3498)](https://www.codacy.com/app/netdata/netdata?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=firehol/netdata&amp;utm_campaign=Badge_Grade) [![Code Climate](https://codeclimate.com/github/firehol/netdata/badges/gpa.svg)](https://codeclimate.com/github/firehol/netdata)
 > *New to netdata? Here is a live demo: [http://my-netdata.io](http://my-netdata.io)*
 
 **netdata** is a system for **distributed real-time performance and health monitoring**.
@@ -10,12 +10,16 @@ _netdata is **fast** and **efficient**, designed to permanently run on all syste
 (**physical** & **virtual** servers, **containers**, **IoT** devices), without
 disrupting their core function._
 
+netdata runs on **Linux**, **FreeBSD**, and **MacOS**.
+
+[![Twitter Follow](https://img.shields.io/twitter/follow/linuxnetdata.svg?style=social&label=New%20-%20stay%20in%20touch%20-%20follow%20netdata%20on%20twitter)](https://twitter.com/linuxnetdata)
+
 ---
 
 ## User base
 
 *Since May 16th 2016 (the date the [global public netdata registry](https://github.com/firehol/netdata/wiki/mynetdata-menu-item) was released):*<br/>
-[![User Base](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_entries&dimensions=persons&label=user%20base&units=null&value_color=blue&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry) [![Monitored Servers](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_entries&dimensions=machines&label=servers%20monitored&units=null&value_color=orange&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry) [![Sessions Served](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_sessions&label=sessions%20served&units=null&value_color=yellowgreen&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry)
+[![User Base](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_entries&dimensions=persons&label=user%20base&units=null&value_color=blue&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry) [![Monitored Servers](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_entries&dimensions=machines&label=servers%20monitored&units=null&value_color=orange&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry) [![Sessions Served](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_sessions&label=sessions%20served&units=null&value_color=yellowgreen&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry) [![Docker Pulls](https://img.shields.io/docker/pulls/titpetric/netdata.svg)](https://hub.docker.com/r/titpetric/netdata/)
 
 *in the last 24 hours:*<br/>
 [![New Users Today](http://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_entries&dimensions=persons&after=-86400&options=unaligned&group=incremental-sum&label=new%20users%20today&units=null&value_color=blue&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry) [![New Machines Today](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_entries&dimensions=machines&group=incremental-sum&after=-86400&options=unaligned&label=servers%20added%20today&units=null&value_color=orange&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry) [![Sessions Today](https://registry.my-netdata.io/api/v1/badge.svg?chart=netdata.registry_sessions&after=-86400&group=incremental-sum&options=unaligned&label=sessions%20served%20today&units=null&value_color=yellowgreen&precision=0&v42)](https://registry.my-netdata.io/#menu_netdata_submenu_registry)
@@ -60,6 +64,7 @@ Netdata is featured at <b><a href="https://octoverse.github.com/" target="_blank
    with just 1% CPU utilization of a single core, a few MB of RAM and no disk I/O at all
    
  - **Sophisticated alarming**<br/>
+   hundreds of alarms, **out of the box**!<br/>
    supports dynamic thresholds, hysteresis, alarm templates,
    multiple role-based notification methods (such as email, slack.com,
    pushover.net, pushbullet.com, telegram.org, twilio.com, messagebird.com)
@@ -89,8 +94,12 @@ Netdata is featured at <b><a href="https://octoverse.github.com/" target="_blank
  - **scales to infinity**<br/>
    requiring minimal central resources
    
- - **back-ends supported**<br/>
-   can archive its metrics on `graphite` or `opentsdb`, in the same or lower detail
+ - **several operating modes**<br/>
+   autonomous host monitoring, headless data collector, forwarding proxy, store and forward proxy, central multi-host monitoring, in all possible configurations.
+   Each node may have different metrics retention policy and run with or without health monitoring.
+   
+ - **time-series back-ends supported**<br/>
+   can archive its metrics on `graphite`, `opentsdb`, `prometheus`, json document DBs, in the same or lower detail
    (lower: to prevent it from congesting these servers due to the amount of data collected)
 
 ![netdata](https://cloud.githubusercontent.com/assets/2662304/14092712/93b039ea-f551-11e5-822c-beadbf2b2a2e.gif)
@@ -99,7 +108,7 @@ Netdata is featured at <b><a href="https://octoverse.github.com/" target="_blank
 
 ## What does it monitor?
 
-netdata monitors several thousands of metrics per device.
+netdata collects several thousands of metrics per device.
 All these metrics are collected and visualized in real-time.
 
 > _Almost all metrics are auto-detected, without any configuration._
@@ -107,13 +116,13 @@ All these metrics are collected and visualized in real-time.
 This is a list of what it currently monitors:
 
 - **CPU**<br/>
-  usage, interrupts, softirqs, frequency, total and per core
+  usage, interrupts, softirqs, frequency, total and per core, CPU states
 
 - **Memory**<br/>
   RAM, swap and kernel memory usage, KSM (Kernel Samepage Merging), NUMA
 
 - **Disks**<br/>
-  per disk: I/O, operations, backlog, utilization, space
+  per disk: I/O, operations, backlog, utilization, space, software RAID (md)
 
    ![sda](https://cloud.githubusercontent.com/assets/2662304/14093195/c882bbf4-f554-11e5-8863-1788d643d2c0.gif)
 
@@ -189,6 +198,9 @@ This is a list of what it currently monitors:
 - **Tomcat**<br/>
   accesses, threads, free memory, volume
 
+- **web server log files**<br/>
+  extracting in real-time, web server performance metrics and applying several health checks
+
 - **mySQL databases**<br/>
   multiple servers, each showing: bandwidth, queries/s, handlers, locks, issues,
   tmp operations, connections, binlog metrics, threads, innodb metrics, and more
@@ -201,12 +213,21 @@ This is a list of what it currently monitors:
 - **Redis databases**<br/>
   multiple servers, each showing: operations, hit rate, memory, keys, clients, slaves
 
+- **mongodb**<br/>
+  operations, clients, transactions, cursors, connections, asserts, locks, etc
+
 - **memcached databases**<br/>
   multiple servers, each showing: bandwidth, connections, items
 
+- **elasticsearch**<br/>
+  search and index performance, latency, timings, cluster statistics, threads statistics, etc
+
 - **ISC Bind name servers**<br/>
   multiple servers, each showing: clients, requests, queries, updates, failures and several per view metrics
 
+- **NSD name servers**<br/>
+  queries, zones, protocols, query types, transfers, etc.
+
 - **Postfix email servers**<br/>
   message queue (entries, size)
 
@@ -215,14 +236,26 @@ This is a list of what it currently monitors:
 
 - **Dovecot** POP3/IMAP servers<br/>
 
+- **ISC dhcpd**<br/>
+  pools utilization, leases, etc.
+
 - **IPFS**<br/>
   bandwidth, peers
 
 - **Squid proxy servers**<br/>
   multiple servers, each showing: clients bandwidth and requests, servers bandwidth and requests
 
+- **HAproxy**<br/>
+  bandwidth, sessions, backends, etc
+
+- **varnish**<br/>
+  threads, sessions, hits, objects, backends, etc
+
+- **OpenVPN**<br/>
+  status per tunnel
+
 - **Hardware sensors**<br/>
-  temperature, voltage, fans, power, humidity
+  `lm_sensors` and `IPMI`: temperature, voltage, fans, power, humidity
 
 - **NUT and APC UPSes**<br/>
   load, charge, battery voltage, temperature, utility metrics, output metrics
@@ -233,6 +266,9 @@ This is a list of what it currently monitors:
 - **hddtemp**<br/>
   disk temperatures
 
+- **smartd**<br/>
+  disk S.M.A.R.T. values
+
 - **SNMP devices**<br/>
   can be monitored too (although you will need to configure these)
 
index 338e6afbd3ef52184c445795a9808b32ef9a8cb8..bea06c3c84030d07cf2c2260bb6ca2c4df678d10 100644 (file)
@@ -3199,7 +3199,7 @@ static void parse_args(int argc, char **argv)
             }
         }
 
-        if(strcmp("version", argv[i]) == 0 || strcmp("-v", argv[i]) == 0) {
+        if(strcmp("version", argv[i]) == 0 || strcmp("-v", argv[i]) == 0 || strcmp("-V", argv[i]) == 0) {
             printf("apps.plugin %s\n", VERSION);
             exit(0);
         }
@@ -3269,7 +3269,7 @@ static void parse_args(int argc, char **argv)
                     "\n"
                     " This program is a data collector plugin for netdata.\n"
                     "\n"
-                    " Valid command line options:\n"
+                    " Available command line options:\n"
                     "\n"
                     " SECONDS           set the data collection frequency\n"
                     "\n"
@@ -3292,7 +3292,7 @@ static void parse_args(int argc, char **argv)
                     "                   apps_groups.conf\n"
                     "                   (default NAME=groups)\n"
                     "\n"
-                    " version           print program version and exit\n"
+                    " version or -v or -V print program version and exit\n"
                     "\n"
                     , VERSION
             );
index 78a3a6f5192330218399f4875056c0c686265dcd..4459de7cac48845dce507b700380af8835299c2b 100644 (file)
@@ -1434,7 +1434,11 @@ int main (int argc, char **argv) {
             }
         }
 
-        if(strcmp("debug", argv[i]) == 0) {
+        if(strcmp("version", argv[i]) == 0 || strcmp("-v", argv[i]) == 0 || strcmp("-V", argv[i]) == 0) {
+            printf("freeipmi.plugin %s\n", VERSION);
+            exit(0);
+        }
+        else if(strcmp("debug", argv[i]) == 0) {
             debug = 1;
             continue;
         }
@@ -1449,21 +1453,55 @@ int main (int argc, char **argv) {
         else if(strcmp("-h", argv[i]) == 0 || strcmp("--help", argv[i]) == 0) {
             fprintf(stderr,
                     "\n"
-                    "netdata freeipmi.plugin " VERSION "\n"
-                    "Usage:\n"
+                    " netdata freeipmi.plugin %s\n"
+                    " Copyright (C) 2016-2017 Costa Tsaousis <costa@tsaousis.gr>\n"
+                    " Released under GNU General Public License v3 or later.\n"
+                    " All rights reserved.\n"
+                    "\n"
+                    " This program is a data collector plugin for netdata.\n"
+                    "\n"
+                    " Available command line options:\n"
+                    "\n"
+                    "  SECONDS                 data collection frequency\n"
+                    "                          minimum: %d\n"
+                    "\n"
+                    "  debug                   enable verbose output\n"
+                    "                          default: disabled\n"
+                    "\n"
+                    "  sel\n"
+                    "  no-sel                  enable/disable SEL collection\n"
+                    "                          default: %s\n"
+                    "\n"
+                    "  hostname HOST\n"
+                    "  username USER\n"
+                    "  password PASS           connect to remote IPMI host\n"
+                    "                          default: local IPMI processor\n"
+                    "\n"
+                    "  sdr-cache-dir PATH      directory for SDR cache files\n"
+                    "                          default: %s\n"
+                    "\n"
+                    "  sensor-config-file FILE filename to read sensor configuration\n"
+                    "                          default: %s\n"
+                    "\n"
+                    "  -v\n"
+                    "  -V\n"
+                    "  version                 print version and exit\n"
+                    "\n"
+                    " Linux kernel module for IPMI is CPU hungry.\n"
+                    " On Linux run this to lower kipmiN CPU utilization:\n"
+                    " # echo 10 > /sys/module/ipmi_si/parameters/kipmid_max_busy_us\n"
+                    "\n"
+                    " or create: /etc/modprobe.d/ipmi.conf with these contents:\n"
+                    " options ipmi_si kipmid_max_busy_us=10\n"
                     "\n"
-                    "  freeipmi.plugin [OPTIONS]\n"
+                    " For more information:\n"
+                    " https://github.com/firehol/netdata/wiki/monitoring-IPMI\n"
                     "\n"
-                    "Available options:\n"
-                    "  NUMBER, sets the data collection frequency\n"
-                    "  debug, enables verbose output\n"
-                    "  sel, enable SEL collection (it is on by default)\n"
-                    "  no-sel, disable SEL collection\n"
-                    "  hostname X, sets the remote host to connect to\n"
-                    "  username X, sets the username to authenticate at the remote host\n"
-                    "  password X, sets the password to authenticate at the remote host\n"
-                    "  sdr-cache-dir X, sets the directory to save SDR cache files\n"
-                    "  sensor-config-file X, set the filename to read sensor configuration\n"
+                    , VERSION
+                    , netdata_update_every
+                    , netdata_do_sel?"enabled":"disabled"
+                    , sdr_cache_directory?sdr_cache_directory:"system default"
+                    , sensor_config_file?sensor_config_file:"system default"
             );
             exit(1);
         }
index 86bd8604be39ba7b6687ed584f4ab88760e5e01c..20722a58f0cd60d8362de62499c9420f589ad2cd 100644 (file)
@@ -230,6 +230,7 @@ struct option_def options[] = {
     { 't', "The internal clock of netdata.",              "seconds",     "1"},
     { 'u', "Run as user.",                                "username",    "netdata"},
     { 'v', "Print netdata version and exit.",             NULL,          NULL},
+    { 'V', "Print netdata version and exit.",             NULL,          NULL},
     { 'W', "See Advanced options below.",                 "options",     NULL},
 };
 
@@ -614,6 +615,7 @@ int main(int argc, char **argv) {
                     config_set(CONFIG_SECTION_GLOBAL, "run as user", optarg);
                     break;
                 case 'v':
+                case 'V':
                     printf("%s %s\n", program_name, program_version);
                     return 0;
                 case 'W':