Syslog 1.22 event color

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
guitou
Posts: 49
Joined: Wed Feb 27, 2008 4:13 am

Syslog 1.22 event color

Post by guitou »

Hi all,
as I understand Event Background Colors are link with the syslog "level" field.
syslog web interface.jpg
syslog web interface.jpg (97.74 KiB) Viewed 1615 times
syslog settings.jpg
syslog settings.jpg (21.3 KiB) Viewed 2454 times
Actually the syslog page only map Facility and Priority rows.
I'm using the latest cacti 0.8.7i with kiwi syslog custom DB format
kiwi DB format.jpg
kiwi DB format.jpg (63.68 KiB) Viewed 2454 times
How i can send the "level" syslog raw information to mysql DB and get syslog message to be colored in web interface?

See attachement if needed

Thanks for your support
Last edited by guitou on Thu Feb 06, 2014 5:32 am, edited 1 time in total.
User avatar
TheWitness
Developer
Posts: 17061
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Syslog 1.22 event color

Post by TheWitness »

Sorry, you have to show me some lines from the database, and there are four tables: 1:syslog, 2:syslog_priorities, 3:syslog_facilities, 4:syslog_host_facilities

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
guitou
Posts: 49
Joined: Wed Feb 27, 2008 4:13 am

Re: Syslog 1.22 event color

Post by guitou »

TheWitness:

here is DATA in table requested (see attachement)

I'm using kiwi syslog daemon in order to push syslog message to mysql DB.
Priority is calculate on the facility and level data => http://www.kiwisyslog.com/kb/info:-sysl ... -priority/

Thanks for your help
Attachments
syslog_priorities.jpg
syslog_priorities.jpg (35.76 KiB) Viewed 2381 times
syslog_host_facilities.jpg
syslog_host_facilities.jpg (14.81 KiB) Viewed 2381 times
syslog_facilities.jpg
syslog_facilities.jpg (15.29 KiB) Viewed 2381 times
syslog.jpg
syslog.jpg (21.21 KiB) Viewed 2381 times
User avatar
bpablo
Posts: 6
Joined: Tue Feb 15, 2011 8:47 am
Location: Buenos Aires, Argentina

Re: Syslog 1.22 event color

Post by bpablo »

I've the same problem.

I've seen that the css class is empty. I have modified the php (creating manually one class), and I see that the cell have the bgcolor that i've set.

Code: Select all

function generate_syslog_cssjs() {
        global $colors, $config, $syslog_incoming_config;
        global $syslog_colors, $syslog_text_colors, $syslog_levels;

        /* legacy css for syslog backgrounds */
        print "\n\t\t\t<style type='text/css'>\n";
        /*if (sizeof($syslog_colors)) {
        foreach ($syslog_colors as $type => $color) {
                if ((isset($syslog_text_colors[$type]) && $syslog_text_colors[$type] != '')) {
                        print "\t\t\t.syslog_$type {\n";
                        if ($color != '') {
                                print "\t\t\t\tbackground-color:#$color;\n";
                        }
                        if (isset($syslog_text_colors[$type]) && $syslog_text_colors[$type] != '') {
                                print "\t\t\t\tcolor:#" . $syslog_text_colors[$type] . ";\n";
                        }
                        print "\t\t\t}\n";
                }
        }
        }*/
        //ADDED BY ME ## BEGIN

        print ".syslog_debug{\n";
        print "background-color:#FF0000;\n";
        print "}\n";
        print "\t\t\t</style>\n";

        //ADDED BY ME ## END

        /* this section of javascript keeps nasty calendar popups from
         * appearing when you hit return.
         */
        ?>
TheWitness, can we help us? :)

This is my limit :(
User avatar
bpablo
Posts: 6
Joined: Tue Feb 15, 2011 8:47 am
Location: Buenos Aires, Argentina

Re: Syslog 1.22 event color

Post by bpablo »

I have a """""TEMPORARY""""" solution for my cacti.
This are the default colors

Code: Select all

       print ".syslog_debug{\n";
        print "background-color:#ed5394;\n";
        print "}\n";
       print ".syslog_emerg{\n";
        print "background-color:#ff0000;\n";
        print "}\n";
       print ".syslog_crit{\n";
        print "background-color:#da4725;\n";
        print "}\n";
       print ".syslog_alert{\n";
        print "background-color:#ff897c;\n";
        print "}\n";
       print ".syslog_err{\n";
        print "background-color:#ffd660;\n";
        print "}\n";
       print ".syslog_warn{\n";
        print "background-color:#fff200;\n";
        print "}\n";
       print ".syslog_notice{\n";
        print "background-color:#d2d8f9;\n";
        print "}\n";
       print ".syslog_info{\n";
        print "background-color:#caf100;\n";
        print "}\n";
       print ".syslog_other{\n";
        print "background-color:#afeced;\n";
        print "}\n";
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest