Graphite integration

This forum was archived to /woltlab and is now in read-only mode.
  • instlled icinga 2 and icinga web 2 on Ubuntu 16.04. reporting and graphite modules are not showing. I couldn't find proper installation procedure documents for those modules. Pls help me to icinga web 2 graphite integration. Guide me or provide me installation steps. Attaching sceenshot for reference.

  • have you followed https://github.com/Icinga/icingaweb2-module-graphite ?

    have you enabled the module ?

  • In the config file, you entered something like

    Code
    1. [graphite]
    2. web_url = http://localhost:9090

    if you browse that, you should see something like shown in the screenshots.

    That must work first.

    Furthermore, the services you want to see must have enable_perfdata=true.

  • So, sru was thankfully quicker than me. https://mobile.twitter.com/dns…status/827061697483530240 (I saw that you deleted your tweets, but anyways).


    One thing to add - Graphite itself must be up and running. Is that the case?

  • if you are not able to expand the icinga2 node in your second screenshot (you take that literally, dont you ;)?) than there seems to be something

    wrong with the whisper files not being created.


    icinga2 feature list shows as enabled:

    Enabled features: api checker command >> graphite << ido-mysql mainlog notification


    /etc/icinga2/features-available/graphite.conf looks like:

    Code
    1. /**
    2.  * The GraphiteWriter type writes check result metrics and
    3.  * performance data to a graphite tcp socket.
    4.  */
    5. library "perfdata"
    6. object GraphiteWriter "graphite" {
    7.   //host = "127.0.0.1"
    8.   //port = 2003
    9. }

    service carbon-cache status is running ?


    ls -l /var/lib/graphite/whisper/icinga2/ has directories named after hosts and services ?

    If that directory is empty, recheck that your service objects have enable_perfdata=true by running:

    icinga2 object list --type service | grep enable_perfdata



    That is all i can guide you in that case.

  • Thanks, @src


    Please find the attachments,


    I am getting an error like unable to see graphs for apt service and when i open the graphs in new tab i am getting error ( Ref : "icinga3 attachment").


    i followed below procedure.



    root@sard:~# icinga2 feature list
    Disabled features: api compatlog debuglog gelf influxdb livestatus opentsdb statusdata syslog
    Enabled features: checker command graphite ido-mysql mainlog notification perfdata



    sudo apt-get update
    sudo apt-get install graphite-web graphite-carbon
    sudo apt-get install postgresql libpq-dev python-psycopg2



    root@sard:~# vim /etc/icinga2/features-available/graphite.conf



    /**
    * The GraphiteWriter type writes check result metrics and
    * performance data to a graphite tcp socket.
    */



    library "perfdata"



    object GraphiteWriter "graphite" {
    //host = "127.0.0.1"
    //port = 2003
    }
    ~




    root@sard:~# service carbon-cache status
    ● carbon-cache.service - Graphite Carbon Cache
    Loaded: loaded (/lib/systemd/system/carbon-cache.service; enabled; vendor pre
    Active: active (running) since Sun 2017-02-05 22:15:21 IST; 3min 12s ago
    Main PID: 30886 (carbon-cache)
    Tasks: 2
    Memory: 19.3M
    CPU: 459ms
    CGroup: /system.slice/carbon-cache.service
    └─30886 /usr/bin/python /usr/bin/carbon-cache --config=/etc/carbon/ca



    Feb 05 22:15:21 sard systemd[1]: Starting Graphite Carbon Cache...
    Feb 05 22:15:21 sard systemd[1]: Started Graphite Carbon Cache.




    root@sard:~# ls -l /var/lib/graphite/whisper/icinga2/
    total 4
    drwxr-xr-x 4 _graphite _graphite 4096 Feb 5 22:15 sard




    root@sard:~# icinga2 object list --type service | grep enable_perfdata
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true
    * enable_perfdata = true



    sudo apt-get install graphite-web graphite-carbon
    77 apt-get install graphite-carbon graphite-web apache2 libapache2-mod-wsgi curl
    78 echo 'CARBON_CACHE_ENABLED=true' >> /etc/default/graphite-carbon
    79 graphite-manage syncdb
    80 chown _graphite:icingaweb2 /var/lib/graphite/graphite.db
    81 a2ensite graphite-web
    82 vim /etc/icinga2/features-available/graphite.conf




    git clone https://github.com/Icinga/icingaweb2-module-graphite
    87 mv icingaweb2-module-graphite graphite
    88 ls
    89 mv /usr/share/icingaweb2/modules/
    90 mv graphite /usr/share/icingaweb2/modules/
    91 cd /usr/share/icingaweb2/modules/
    92 ls
    93 cd graphite
    94 mkdir -p /etc/icingaweb2/modules/graphite
    95 cp -rv sample-config/icinga2/* /etc/icingaweb2/modules/graphite
    96 vi /etc/icingaweb2/modules/graphite/config.ini
    97 chown -R root:icingaweb2 /etc/icingaweb2/modules/graphite
    98 chmod -R 2755 /etc/icingaweb2/modules/graphite
    99 vi /etc/icingaweb2/modules/graphite/config.ini
    100 vim /etc/default/graphite-carbon
    101 vim /etc/carbon/carbon.conf
    102 vim /etc/carbon/storage-schemas.conf
    103 cp /usr/share/doc/graphite-carbon/examples/storage-aggregation.conf.example /etc/carbon/storage-aggregation.conf
    104 vim /etc/carbon/storage-aggregation.conf
    105 service carbon-cache restart
    106 apt-get install apache2 libapache2-mod-wsgi
    107 a2dissite 000-default
    108 cp /usr/share/graphite-web/apache2-graphite.conf /etc/apache2/sites-available
    109 a2ensite apache2-graphite
    110 service icinga2 restart
    111 icinga2 feature enable livestatus statusdata
    112 service icinga2 restart
    113 vim /etc/carbon/carbon.conf
    114 ls
    115 vim /etc/icingaweb2/modules/graphite/config.ini
    116 service carbon-cache restart
    117 service icinga2 restart

  • Wolfgang :

    But everything is working fine for the hostalive check - according to the first screenshot.

    So, why do we have a problem with the service apt ?

    As we can see, there *is* performance data available.


    rajeshballa :

    would you please recheck that


    enable_perfdata is enabled for that service (i know, you did that for all services, but please recheck:

    icinga2 object list --type service --name 'sard!apt'


    you have data of that service:

    Code
    1. root@sard:/var/lib/graphite/whisper/icinga2/sard/services/apt/apt/perfdata# ls -l
    2. total 8
    3. drwxr-xr-x 2 _graphite _graphite 4096 Jan 11 11:44 available_upgrades
    4. drwxr-xr-x 2 _graphite _graphite 4096 Jan 11 11:44 critical_update
    5. root@sard:/var/lib/graphite/whisper/icinga2/sard/services/apt/apt/perfdata# whisper-dump available_upgrades/value.wsp


    If that is the case, then at least data is rolling in and should be queryable with a browser at http://sard:8000.


    Regarding Wolfgangs idea, please check if is executable:

    Code
    1. root@sard:/var/lib/graphite/whisper/icinga2/debian85_local/services/apt/apt/perfdata# cd /usr/share/grafana/vendor/phantomjs/
    2. root@sard:/usr/share/grafana/vendor/phantomjs# ls
    3. phantomjs render.js
    4. root@sard:/usr/share/grafana/vendor/phantomjs# ./phantomjs
    5. phantomjs>

    The post was edited 1 time, last by sru ().

  • But everything is working fine for the hostalive check - according to the first screenshot.

    Arrrgghh. Yep, you're right that JPG support IS installed, support for PNG files seems to be missing instead so the contents is shown, not the image,

    Maybe the Apache logs contain some error messages.


    Sorry for mixing it up :(

  • @src


    root@sard:~# icinga2 object list --type service --name 'sard!apt'



    Object 'sard!apt' of type 'Service':
    % declared in '/etc/icinga2/conf.d/apt.conf', lines 1:0-1:18
    * __name = "sard!apt"
    * action_url = ""
    * check_command = "apt"
    % = modified in '/etc/icinga2/conf.d/apt.conf', lines 4:3-4:23
    * check_interval = 60
    % = modified in '/etc/icinga2/conf.d/templates.conf', lines 28:3-28:21
    * check_period = ""
    * check_timeout = null
    * command_endpoint = ""
    * display_name = "apt"
    * enable_active_checks = true
    * enable_event_handler = true
    * enable_flapping = false
    * enable_notifications = true
    * enable_passive_checks = true
    * enable_perfdata = true
    * event_command = ""
    * flapping_threshold = 30
    * groups = [ ]
    * host_name = "sard"
    % = modified in '/etc/icinga2/conf.d/apt.conf', lines 1:0-1:18
    * icon_image = ""
    * icon_image_alt = ""
    * max_check_attempts = 5
    % = modified in '/etc/icinga2/conf.d/templates.conf', lines 27:3-27:24
    * name = "apt"
    % = modified in '/etc/icinga2/conf.d/apt.conf', lines 1:0-1:18
    * notes = ""
    * notes_url = ""
    * package = "_etc"
    % = modified in '/etc/icinga2/conf.d/apt.conf', lines 1:0-1:18
    * retry_interval = 30
    % = modified in '/etc/icinga2/conf.d/templates.conf', lines 29:3-29:22
    * templates = [ "apt", "generic-service" ]
    % = modified in '/etc/icinga2/conf.d/apt.conf', lines 1:0-1:18
    % = modified in '/etc/icinga2/conf.d/templates.conf', lines 26:1-26:34
    * type = "Service"
    * vars = null
    * volatile = false
    * zone = ""
    root@sard:~#
    root@sard:~# cd /var/lib/graphite/whisper/icinga2/sard/services/apt/apt/perfdata root@sard:/var/lib/graphite/whisper/icinga2/sard/services/apt/apt/perfdata# ls - l
    total 8
    drwxr-xr-x 2 _graphite _graphite 4096 Feb 5 22:16 available_upgrades
    drwxr-xr-x 2 _graphite _graphite 4096 Feb 5 22:16 critical_updates
    root@sard:/var/lib/graphite/whisper/icinga2/sard/services/apt/apt/perfdata# whis per-dump available_upgrades/value.wsp
    Meta data:
    aggregation method: average
    max retention: 86400
    xFilesFactor: 0.5



    Archive 0 info:
    offset: 28
    seconds per point: 60
    points: 1440
    retention: 86400
    size: 17280



    Archive 0 data:
    0: 1486313160, 18
    1: 1486313220, 18
    2: 1486313280, 18
    3: 1486313340, 18
    4: 1486313400, 18
    5: 1486313460, 18
    6: 1486313520, 18
    7: 1486313580, 18
    8: 1486313640, 18
    9: 1486313700, 18
    10: 1486313760, 18
    11: 1486313820, 18
    12: 0, 0
    13: 1486313940, 18
    14: 1486314000, 18
    15: 1486314060, 18
    16: 1486314120, 18
    17: 1486314180, 18
    18: 0, 0
    19: 1486314300, 18
    20: 1486314360, 18
    21: 1486314420, 18
    22: 1486314480, 18
    23: 1486314540, 18
    24: 1486314600, 18
    25: 1486314660, 18
    26: 1486314720, 18
    27: 1486314780, 18
    28: 1486314840, 18
    29: 1486314900, 18
    30: 1486314960, 18
    31: 0, 0
    32: 0, 0
    33: 0, 0
    34: 0, 0
    35: 0, 0
    36: 0, 0
    37: 0, 0
    38: 0, 0
    39: 0, 0
    40: 0, 0
    41: 0, 0
    42: 0, 0
    43: 0, 0
    44: 0, 0
    45: 0, 0
    46: 0, 0
    47: 0, 0
    48: 0, 0
    49: 0, 0
    50: 0, 0
    51: 0, 0
    52: 0, 0
    53: 0, 0
    54: 0, 0
    55: 0, 0
    56: 0, 0
    57: 0, 0
    58: 0, 0
    59: 0, 0
    60: 0, 0
    61: 0, 0
    62: 0, 0
    63: 0, 0
    64: 0, 0

  • At my debian 8.7, i have:


    Code
    1. root@debian85:~# dpkg -l | grep -i png
    2. ii libpng12-0:amd64 1.2.50-2+deb8u3 amd64 PNG library - runtime

    and am able to browse https://i.stack.imgur.com/ILTQq.png .

    Does that work for you ?


    At least we are sure that there are datapoints comming in for apt.

    So it should boil down to a render / display problem.

    The post was edited 1 time, last by sru ().