Plugin Architecture for Cacti and Monitoring Module

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
qpduong
Posts: 11
Joined: Tue Jul 26, 2005 7:59 pm
Contact:

Post by qpduong »

hi cigamit,

good news: thold and monitor plugins are intergrated smoothly with 0.8.6f on Win32 but.........................

bad news: "current value" from thold is always 0 so thold makes wrong trigger.

Btw can you add audible alarm to thold beside syslog and email (I like this feature of monitor plugins so much :D )

rgds,
qpduong
Attachments
currentvalue.gif
currentvalue.gif (37.8 KiB) Viewed 6937 times
goodvalue.gif
goodvalue.gif (56.12 KiB) Viewed 6937 times
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

qpduong wrote:hi cigamit,

good news: thold and monitor plugins are intergrated smoothly with 0.8.6f on Win32 but.........................

bad news: "current value" from thold is always 0 so thold makes wrong trigger.

Btw can you add audible alarm to thold beside syslog and email (I like this feature of monitor plugins so much :D )

rgds,
qpduong
Thanks for catching that so fast. I looked over the code, and I definitely was not compensating for Win32 at all. I have updated the plugin (just a small change in setup.php) and it should now be working correctly. If you wouldn't mind giving it another go and make sure that it is now working correctly, I would appreciate it.

An audible alarm is definitely something that can be added. I am going to be enhancing the alarm on the monitor plugin to allow the sound to be selectable and you can choose any audio file you like. There are a few other configuration options that I also plan on adding such as a configurable width, maybe even icon "themes". I want to find a way to incorporate the fast-poller also and I think I already have a simple solution.

My Auto-Discover plugin is nearly complete, I am just adding a few finishing touches to it. So look for it soon.

I have also been thinking of adding a plugin to help with the growing cacti.log file (and thold.log). I know that Cacti 0.9 already includes moving the log to a SQL database, but until that is stable, it would be fairly simple to have a plugin do it for now. Either that, or add some simple log management like only keeping the last 1000 lines, or archiving the log every 24 hours. Thoughts?
qpduong
Posts: 11
Joined: Tue Jul 26, 2005 7:59 pm
Contact:

Post by qpduong »

hi cigamit,

nothing changes, still get the same prob. (with thold2.1b I didn't face this prob.) Is there any ways to turn on debugging to see what's happening?

rgds,
qpduong
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

qpduong wrote:hi cigamit,

nothing changes, still get the same prob. (with thold2.1b I didn't face this prob.) Is there any ways to turn on debugging to see what's happening?

rgds,
qpduong
We need to see the command line that is being ran. Inorder to do that, open setup.php and goto line 147, you should see this.
// cacti_log("DEBUG: $command_string $extra_args", true, "POLLER");

Just remove the // and save it. Now let it go through a polling cycle, and look at your polling log. That should get us started. I will also see about installing cacti on win32 today inorder to have my own testbed.
skuzbucket
Posts: 16
Joined: Thu Jul 14, 2005 8:55 am

Post by skuzbucket »

cigamit wrote: I will also see about installing cacti on win32 today inorder to have my own testbed.
Once you have this done, can you post a quick blurb on the install process?

EDIT: Ok - nevermind...

Ill be looking for the win32 fix for the current value problem that is talked about above.

Thanks for a great system :)
skuzbucket
Posts: 16
Joined: Thu Jul 14, 2005 8:55 am

Found a few errors

Post by skuzbucket »

Undefined variable: hostid in D:\webroot\cacti.XXXXXXX.com\cacti\plugins\thold\thold.php on line 95
Undefined index: threshold in D:\webroot\cacti.XXXXXXX.com\cacti\plugins\thold\thold.php on line 97
Undefined index: hostid in D:\webroot\cacti.XXXXXXX.com\cacti\plugins\thold\thold.php on line 336

URL:

/cacti/plugins/thold/thold.php?rra=360&view_rrd=970

Any ideas?
Attachments
error.JPG
error.JPG (148.63 KiB) Viewed 6870 times
Last edited by skuzbucket on Wed Aug 03, 2005 12:27 pm, edited 2 times in total.
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

sweet addon!

Post by egarnel »

I upgraded my internal test cacti box from 86d to 86f and did the following:

down'ld the plugin patch, monitor & thold
patched the files with only one reject - config.php so I manually moved it into place and edited the file.

poked around and finally figured out that the monitor & thold dirs need to be under the plugins dir and not the cacti base dir.

Awesome tool!

before I go and put it on my production server, has any one tried it on Cacti 86e patched up to 86f?
User avatar
egarnel
Cacti Pro User
Posts: 708
Joined: Thu Nov 21, 2002 8:55 am
Location: Austin, TX

Post by egarnel »

to answer my own question.....
No, it did not seem to work. After the plugin patch, I got the install/upgrade page for some reason...hmmmm

different server, everything is the same down to the metal except that the 1st was an 86d to 86f upgrade and the 2nd was a patched 86e install...

will have to go back to the drawing board for this one.
thank goodness for backups, I was able to roll back the old cacti dir and not even miss a poll!

tar - "It's not just for putting on doorknobs anymore"
skuzbucket
Posts: 16
Joined: Thu Jul 14, 2005 8:55 am

Post by skuzbucket »

Cigamit:

Any ideas on the Current Showing zero problem? Im not a php guy so I don't really know where to start. :oops:
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

skuzbucket wrote:Cigamit:

Any ideas on the Current Showing zero problem? Im not a php guy so I don't really know where to start. :oops:
I believe I have the problem figured out. I have created a workaround and have updated the plugin. The problem seems to be an original THold problem that only showed up on Windows hosts under odd circumstances. Browsing the thold thread I have found someelse that had the same issue.

Go ahead and give it ago and let me know if it now works for you.
qpduong
Posts: 11
Joined: Tue Jul 26, 2005 7:59 pm
Contact:

Post by qpduong »

ur so great, it works like champ now :D. Would you mind helping me make threshold play a specific audible file just like ur monitor does (we have 24h duty staffs so audible alarms are prefer over syslog or email).

Rgds,
qpduong
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Found a few errors

Post by cigamit »

skuzbucket wrote:Undefined variable: hostid in D:\webroot\cacti.XXXXXXX.com\cacti\plugins\thold\thold.php on line 95
Undefined index: threshold in D:\webroot\cacti.XXXXXXX.com\cacti\plugins\thold\thold.php on line 97
Undefined index: hostid in D:\webroot\cacti.XXXXXXX.com\cacti\plugins\thold\thold.php on line 336

URL:

/cacti/plugins/thold/thold.php?rra=360&view_rrd=970

Any ideas?
Are you by chance using this on an older threshold database, or is it fresh? The old threshold module had an issue where under certain circumstances, it would not add the hostid for the threshold into the database. The patches I have applied to my plugin correct this problem, but only for newly created thresholds.

I am looking into this currently and will update this post once I find something.
--
EDIT: Verified another instance of where this can occur. I am currently debugging it to see the best way of patching it.

EDIT: Patched: It will now pull the host id from the database if it isn't passed. I have updated the Plugin and the Plugin Version. Thanks Guys and keep those bug reports coming!
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

qpduong wrote:ur so great, it works like champ now :D. Would you mind helping me make threshold play a specific audible file just like ur monitor does (we have 24h duty staffs so audible alarms are prefer over syslog or email).

Rgds,
qpduong
Its already the #3 thing on my list at the moment.

#1 is embedded graph images in the email (already working on my custom, just need to add to plugin, so it should be done fairly quick)
#2 is threshold templates for data sources (most of it is done, just need to write the interface)

Once those 2 things are done, the sound options will be added in. Don't fret, it will not take long at all. If you really want, I could possibly send you a small modification/patch that will get it done for now.
skuzbucket
Posts: 16
Joined: Thu Jul 14, 2005 8:55 am

Meta Refresh added to monitor

Post by skuzbucket »

Can you add something REALLY simple to the monitor page? A setting that will allow you to set how often the monitor page refreshes automatically? Right now you need to manually reload it.

Just an idea

Thanks again Jimmy!
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Meta Refresh added to monitor

Post by cigamit »

skuzbucket wrote:Can you add something REALLY simple to the monitor page? A setting that will allow you to set how often the monitor page refreshes automatically? Right now you need to manually reload it.

Just an idea

Thanks again Jimmy!
Hum... it should reload every 5 minutes (as per the normal graph refresh). I had just added the hook in the last update to the Plugin Architecture so that I can make it refresh at a configurable rate. The only problem now is that the poller still only scans the host for their status every 5 minutes.

My slightly modified cacti does the refresh every 30 seconds, and I run a faster version of the poller which just checks for host up every minute. I will see about updating it real quick, and I will include the faster poller with it. You will have to set your own Cron job/Task to run it though. I will also make the time configurable (in seconds).
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests