Linux to Windows WMI Plugin - Beta

Announcements concerning Plugins for Cacti

Moderators: Developers, Moderators

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

Post by cigamit »

I had actually written this several months ago, just haven't had the time to clean it up enough to release it. That and I wanted to finish several other options (auto building of XML files, Data Queries, Data Templates) but instead went ahead and put it out their in case anyone else found it handy.

It still has a long way to go, but it works fairly well in my setup.
User avatar
anx
Posts: 21
Joined: Sat Apr 28, 2007 1:47 am
Location: Melbourne, Australia
Contact:

Post by anx »

Cigamit, relax man, I was joking! :D

I like it, just unlucky on my part as now I have to do the graphs again, your way is better by far.

I appreciate your sharing your work, at least we are not like that prick lints who didn't even bother.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Relax? Heh, I was really just telling you about some of the upcoming features. There is A LOT planned for this plugin, I just have to find the time to finish it, or find someone to take it over to take the load off me.
User avatar
anx
Posts: 21
Joined: Sat Apr 28, 2007 1:47 am
Location: Melbourne, Australia
Contact:

Post by anx »

Sorry dude, read your post wrong, apologies.

It's an excellent bit of work, if I had your skill, I'd certainly help you out with the development, alas I'm just a humble network engineer.

Saying this, I will have a long hard look at it, even if I can't figure out the code, I should be able to do some nice templates.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

If you could create some templates for it, that would be awesome. I created a few but I don't particularly monitor much through WMI just yet. Let me know if I can give you any pointers on how to go about it. Most of it fairly easy to accomplish as is, just a quick change in the XML and Data Queries I already have.
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

I'm throwing this into beta for our users next week, so I should have some templates to flip back in a couple of weeks.

But since it is Windows, the users ask for some pretty retarded stuff, so they may not be all that useful :)
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Eruh, did you say reeetaaarrrrdddded?

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?
User avatar
Linegod
Developer
Posts: 1626
Joined: Thu Feb 20, 2003 10:16 am
Location: Canada
Contact:

Post by Linegod »

Yes. Yes I did.
--
Live fast, die young
You're sucking up my bandwidth.

J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

I'm wondering how this plugin handles WMI data which has to be cooked and also recorded over time. E.g. disk I/O which requires two queries an interval apart to work out reads/writes per interval.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

claymen wrote:I'm wondering how this plugin handles WMI data which has to be cooked and also recorded over time. E.g. disk I/O which requires two queries an interval apart to work out reads/writes per interval.
That's how a lot of SNMP queries like interface traffic already work. The device actually records bytes-transferred-ever and Cacti figures out the rate from that.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

Well I configured it all up today and ran into a few problems.

a) passwords are not being escaped or encapsulated when passed to the command line. this means for companies like us where we have a mandatory complex password with random ascii char's that the script will fail.

b) fixing that issue noted above breaks the database query as adjusting the actual path it executes to encapsulate the password and username in ' means it un encapsulates part of a SQL query.

I'll have a look tomorrow and see whether I can work around this. Otherwise it seems to be quite a nice solution although I have not tested how well it'll handle the cooking as it wasnt a straight forward over time calc it uses a frequency as well.

Check out some here
http://search.cpan.org/src/JDB/Win32-Pe ... /calc.html
scardus
Posts: 9
Joined: Wed Jan 17, 2007 8:19 am

Post by scardus »

cigamit wrote:It means it needs the SH shell
#!/bin/sh

Honestly, if you are having trouble at this point, the dependencies are going to be a nightmare for you to fix. What OS are you running on?
Either that, or the script is in DOS format with ^M's at the end of each line. Try running it through dos2unix...

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

Post by cigamit »

When I was testing, I could not get the binaries to work at all (wmic) if you have a ' or " in the password, so I didn't bother implementing that into the plugin. I work for a company that mandates random 14 character password with multiple symbols, but they don't mandate that there has to be a \ " ' in it, so we just don't use those symbols by general rule of thumb.
User avatar
claymen
Cacti User
Posts: 259
Joined: Mon Aug 18, 2008 4:30 am
Location: Australia
Contact:

Post by claymen »

The issue isnt having ' or \ in a password its that when passing characters like @ or # etc through to the script it is causing bash to freak out.

With that said this is more a failing with cacti as I would have hoped that when passing data to the command line that it would escape any nasty characters out.

Additionally what we were doing was encapsulating the password with single quotes which worked for our existing scripts but doesnt work for the plugin. Additionally on some versions of cacti it would throw some nasty SQL errors which again concerns me that these arent being escaped before being put into a SQL query.
whoiswes
Posts: 1
Joined: Wed Dec 10, 2008 8:37 am

Post by whoiswes »

cigamit-

First, thanks for working on this plugin, we just started testing/working with cacti a few weeks ago and your plugin will be a HUGE help in us finally getting performance metrics on all of our servers.

That said, I have a few questions/observations:

1. in the zip file in the original post, I think you have the SMTP Queues template but the Exchange messages resource XML. No biggie as I was able to use both to create my own but it took me a while to sort that out. I might also be completely off base here so my apologies if I am.

2. For anyone authenticating off A/D, I could not get 2003-style usernames working (user@domain) and had to use the older DOMAIN\user format (this is probably due to our domain being misconfigured versus the script). HOWEVER, you have to use a double-backslash in the username (ie, domain\\username) in the account setup otherwise the query fails. This has taken me 4 days to figure out.

That's all for now, I literally just got the query working 5 minutes ago so if/when I have more information or some samples to post (not that they'd be worth much but I'll do what I can to help!) I will.

Thanks again to you all!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests