Updating the Banner plugin for Cacti v1.1.x

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Moderators, Developers

Post Reply
Author
Message
name
Posts: 1
Joined: Wed Jun 14, 2017 5:35 am

Updating the Banner plugin for Cacti v1.1.x

#1 Post by name » Wed Jun 14, 2017 6:07 am

Hi,

I am updating the banner plugin (http://docs.cacti.net/userplugin:banner) for PIA 3.1/Cacti v1.1.x (1.1.10).
For those who don't know what it is, it is a plugin you can use to display a banner at the top of Cacti so that users can be informed of certain events (for instance Scheduled Downtime, etc.).

Currently I am running into two problems.

Cacti doesn't support the "body_style" plugin hook anymore. I have replaced the <body> tag in include/top_graph_header.php and in include/top_header.php to:

Code: Select all

<body <?php print api_plugin_hook_function("body_style", "");?>>
The plugin works for the themes: Classic, Dark, Modern, but I have an issue with Paper-plane and Paw.

Because the plugin takes in some room on the last two themes the scroll bar is changed. If for instance try to change a users Theme, the Return and Save buttons drop off the screen, so you can't select them.

Attached my codechange for the the plugin, I haven't changed the original developer, because he did a lot more than me.

I hope someone can help me on how I could integrate the plugin better into the net Plugin Architecture?

Thank you in advance.
Attachments
banner.tar.gz
Banner Plugin v1.00
(20.5 KiB) Downloaded 119 times

User avatar
Pucho
Cacti User
Posts: 180
Joined: Wed Jul 20, 2016 8:00 pm

Re: Updating the Banner plugin for Cacti v1.1.x

#2 Post by Pucho » Wed Jun 14, 2017 4:06 pm

Have you read this? https://github.com/Cacti/cacti/wiki/PluginMigration

I can't help you much there but it might worth the read.
Cacti - 1.1.37
Poller Type - Spine
Weathermap 0.98a
Server Info - Linux 3.10.0 - Centos 7
Web Server - Apache/2.4.6 PHP 5.4.16
MySQL - 5.5 ;RRDTool - 1.4.8 ;SNMP - 5.7.2
Religion - Anti forum pets

Code: Select all

SYSTEM STATS: Time:17.7383 Method:spine Processes:1 Threads:10 Hosts:279 HostsPerProcess:279 DataSources:7309 RRDsProcessed:3718

Code: Select all

WEATHERMAP STATS: Weathermap 0.98 run complete - Thu, 16 Nov 17 08:42:56 +1300: 39 maps were run in 23.22 seconds with 0 warnings.

User avatar
Osiris
Cacti Pro User
Posts: 863
Joined: Mon Jan 05, 2015 10:10 am

Re: Updating the Banner plugin for Cacti v1.1.x

#3 Post by Osiris » Sat Jul 08, 2017 9:29 pm

I would rewrite the whole thing in javascript using jQuery. Still a plugin of course.
Before history, there was a paradise, now dust.

Post Reply