Contents
New Version 2017 for Centreon Reporting Auto E-Mail
1. Centreon Reports
2. Nagios Reports
3. Posible Improvements
4. Othe tools Links

1.Centreon Reports

It has a very nice web interface, but  In my opnion Centreon lacks a lot in Reporting, it can be improved in many many ways.
Right now it lets you choose a Host/HostGroup/ServiceGroup and Period Selection: Yestarday/This Week/Last 7 days/This Month/Last 30 days/Last Month…
Then it lets you custom select from what day untill what day, but

2.Nagios Reports

It gets data from log_archive_path=/usr/local/nagios/var/archives/   (check your  nagios.cfg).
By default it rotates every day, the files look like these:
[1249336606] SERVICE ALERT: SJ136;Memoria Virtual;WARNING;SOFT;1;Disk WARNING – Virtual Memory [1249336613] SERVICE ALERT: SJ219;Conexion-HTTPS-OWA;OK;SOFT;2;HTTP OK HTTP/1.1 200 OK – 9082 [1249336791] SERVICE ALERT: SJ136;Memoria Virtual;WARNING;SOFT;2;Disk WARNING – Virtual Memory …
Really cool to play with the custom reports here:
http://<NAGIOS_SEVER>/nagios/cgi-bin/summary.cgi?btnSubmit=Generate+New+Report
Notice that these page will not allow hour/minute but you can play with the query like:
http://<NAGIOS_SEVER>/nagios/cgi-bin/summary.cgi?report=1&displaytype=3&timeperiod=lastweek&smon=6&sday=1&syear=2009&shour=8&smin=0&ssec=0&emon=6&eday=22&eyear=2009&ehour=24&emin=0&esec=0&hostgroup=Win2k3_Exchange&servicegroup=all&host=all&alerttypes=2&statetypes=2&hoststates=7&servicestates=32&limit=25
The nagios-reporter.v131.pl (bellow) is a great script that builds upon these URL  parses the result and send an email.
Also the nagios reports could be Improved very much.

3. Posible Improvements

Centreon Posible Improvement 1:
First of it would be to add Hour/Minute to the selection.
Nowhere you can choose hours or minutes, or predifined Top 10, like nagios.
I tried to change the source /usr/local/centreon/www/main.php and
/usr/local/centreon/www/include/reporting/dashboard/DB-Func.php but I found out the problem is in the DB where the date information is stored in Unix time, in Centstorage date_end / date_start. Value like: 1222725600      1222639200
The big problem is, those values do not contain hour/minute information, only days!
Centreon/Nagios Posible Improvement 2:
Allows sorting in web the reports by most Down/UP, Critical/OK etc…
Centreon Posible Improvement 3:
The export to excel puts the date in UNIX format or something because they come really strange.
Nagios has no option to export.
Centreon/Nagios Posible Improvement 4:
Export directly to PDF
Centreon/Nagios Posible Improvement 5:
Allow to auto send reports preconfigured, probably a lot of work but would be really cool.
I actualy have this setup with a perl script that uses Nagios reports from web and parses and sends an email.
Here is my post about it.
Centreon Posible Improvement 6:
In distributed architetures, the reports behaves funny. I get no data under Service.
I tried both for local and remote poolers.
These can be a big problem for large setups, because the nagios reports would only see the checks
its doing on its own server. So you would have to query each server for a certain Host.
Nagios Posible Improvement 7:
Why have only these Limited Report Type, now we have:
25 Most Recent hard Alerts / 25 Most Recent hard hosts Alerts / Top 25 Most Hard Service Alerts etc…
anyways its cool because from the previous mentioned URL we can customize much.
But it seems just a metter of developing a better web GUI for it.

5.Other Tools Links

NXE Nagios XML Engine
“NXE will report the status of one or more Nagios systems as XML, it will allow you to transform the status XML using XSLT stylesheets to the format of your choice and NXE will process and create Nagios external commands on your behalf allowing you to control operations of your Nagios system via standard XML interfaces.”
I have not personaly tested it but I believe it was developed for Nagios 2, not sure if it would work with Nagios 3.
http://nxe.sourceforge.net/about.html

Nareto

A french group that developed this nice real time appliaction that works with Nagios, I tried really hard
to make it work with Nagios 3, no luck. I tried contaction the developers, but it looks like they have abandon
the project. This tool is also included in FAN (Fully Automated Nagios). Website is in french only.
http://www.nareto.org
nagios_report.py
A script from asanabria6910 at nagiosexchange.org
It covers the need to send a daily reports of every host that has been down since midnight?
Its written in python and I have not tested.
http://www.monitoringexchange.org/cgi-bin/page.cgi?g=2749.html;d=1
nagios-reporter.v131.pl
Perl script can request an overnight, daily, weekly or monthly report from the Nagios server using the standard CGIs, It fetches Nagios report from web, processes HTML/CSS and emails to someone.
I tested it is what I have been using, really nice script! I even customized for the time period I needed.
It was the best solution, I even put it in cron so I get a report every week for the top 10 services that have the most critical alerts from 8 to 20h.
Thanks to Rob Moss, for these great script.
Note:This script requires Perl 5 and Bundle::LWP Net::SMTP Date::Manip Getopt::Long
hhttp://www.monitoringexchange.org/cgi-bin/page.cgi?g=2154.html;d=1
Download here
I wrote a modified version of these script and it can be download here

Tags: , , , , , , , ,

4 thoughts on “Reporting in Nagios Centreon

  1. dear felipe,
    thanks for your “How to”. I interest to trying nagios-reporter.pl for my nagios monitoring to send me a summary report for last 24 hours and sending every 08:00 AM to my email. unfortunately, when i running that script to test
    ns1:/home# perl nagios-reporter.pl
    I got error message like below :
    ERROR: Date::Manip unable to determine Time Zone.
    at /usr/local/share/perl/5.10.0/Date/Manip.pm line 3666
    Date::Manip::Date_TimeZone() called at /usr/local/share/perl/5.10.0/Date/Manip.pm line 693
    Date::Manip::Date_Init() called at /usr/local/share/perl/5.10.0/Date/Manip.pm line 3753
    Date::Manip::Date_PrevWorkDay(‘today’, 1) called at nagios-reporter.pl line 144
    main::report_daily() called at nagios-reporter.pl line 42
    what the problem persist..? is it related to timezone ? fyi, my timezone is ASIA/JKT
    if you can help me..it’s very helpful for me
    thanks beforehand
    regards,
    Rhiez

  2. it works now…just ignore my above question bro 🙂
    thanks for your information

  3. Hi Dear, is there possible to make a web page or form to transfer variable to the nagios-reporter.v131.pl and generate a web report directly, I am new on nagios

  4. Hi Dear, I have configured the pl script it working fine. I got the mail from that server but with status report.
    Alert Summary Report
    Last Updated: Sat Jul 16 11:32:44 IST 2011
    Nagios® Core™ 3.2.3 – http://www.nagios.org
    Logged in as syscon
    Most Recent Alerts
    07-14-2011 07:00:00 to 07-16-2011 07:00:00
    Duration: 2d 0h 0m 0s
    Report Options Summary:
    Alert Types: Host & Service Alerts
    State Types: Hard States
    Host States: Down, Unreachable
    Service States: Warning, Unknown, Critical
    Displaying all 0 matching alerts
    Time Alert Type Host Service State State Type Information
    Please help me to configure the same.

Leave a Reply

Your email address will not be published. Required fields are marked *