CLI for Cacti?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
bpawlik
Posts: 3
Joined: Tue May 24, 2005 7:39 am
Location: Bloomfield Hills, MI

CLI for Cacti?

Post by bpawlik »

OK... Many apologies, because I know this question has been asked many times in the past... I've read many threads in the various Cacti forums with folks attempting to use external DS with Cacti. I have also seen folks looking to use a CLI for Cacti (cacti_inject). However, cacti_inject doesn't seem to be available anymore. Is this true?

Is there a script out there that would allow one to add a large amount of data sources into cacti? Is there a script that will allow one to also create graphs for these datasources?

If not, is there a place to actually obtain the data dictionary for Cacti so that one could develop a CLI? I have over 400 servers with anywhere between 10 and 50 datasources per server. I could spend the next few years clicking away at the Cacti screens, but my Unix Master would probably deal me a crushing blow to the temples for using a mouse so much. I have an outline of a script written that will allow me to do this task, however I have hit a road block with some of the relational items in the DB (this is where the dictionary would help me out greatly). I would be more than willing to share my script with the world, but I feel like one - it should work correctly, and two, it should be in line with the development of Cacti itself.


Thanks for comments/replies in advance...
Brian
Pulte Homes, Inc.
Bloomfield Hills, MI
mshook
Posts: 46
Joined: Mon May 02, 2005 3:33 pm
Location: New York, NY

Post by mshook »

Brian,

You should try to get in touch with Moshe. See this thread:
http://forums.cacti.net/viewtopic.php?t=7683

- Mathieu
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Someone is already working on this in the Script and Addon's section of the forums.

A "mass add" script is planed for future releases. And I have to warn everyone developing them that the database has changed in the next release.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
mshook
Posts: 46
Joined: Mon May 02, 2005 3:33 pm
Location: New York, NY

Post by mshook »

rony wrote:A "mass add" script is planed for future releases. And I have to warn everyone developing them that the database has changed in the next release.
Next release being 0.9?
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Correct, next release is 0.9.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
bpawlik
Posts: 3
Joined: Tue May 24, 2005 7:39 am
Location: Bloomfield Hills, MI

Post by bpawlik »

Thanks you mshook and rony for your thoughts and direction... I'll give the add_device.php script a go and see if that helps dissolve some of the work ahead of me! But I have to say the a CLI would really do the entire trick.

rony... I understand your point exactly! I had read that the DB was changing dramtically, so I changed my approach. I have written a script that will create xml templates for data and graphing based on a CSV file. It's nothing fancy, nor does it give you anything but a bland graph once imported, but I figure it's easier to go back and make the cosmetic changes in cacti (less clicks) after I import the templates for the 50-60 different perf counters I collect.

Here's a run down of what I've done...
- I have a need to collect Windows (:-?)
) performance stats
- I have setup the perf logs in win to output to a csv file (1 second intervals - yeah 1 sec cuz that's what we require)
- Every 5 mins those csv files containing perf stats get RCPed to the linux host that runs cacti :D
- I have a script running from crontab that will pick up the stats and backfill the RRA with data (some tweaking had to be done in the creation of rras)
- Then the RRA will be setup in cacti for viewing and thresholds, etc...


I would have used the poller to add the data to the RRAs, but I couldn't get it to backfill data from the past 5 mins at 1 sec intervals. Basically, I couldn't have my poller run every 1 sec to load stats into the RRAs.


Maybe I missed something along the way or I just like doing things the hard way, but I appreciate the comments thus far. Thanks!
Brian

/dev/null is my best friend...
bpawlik
Posts: 3
Joined: Tue May 24, 2005 7:39 am
Location: Bloomfield Hills, MI

Post by bpawlik »

Pardon me if you get asked this every minute of everyday... when can we expect 0.9?

BTW - This app really rocks and you guys did a great job with it thus far!
Brian

/dev/null is my best friend...
mshook
Posts: 46
Joined: Mon May 02, 2005 3:33 pm
Location: New York, NY

Post by mshook »

rony wrote:Correct, next release is 0.9.
Alright so if we were to cover all bases, we'll have to get busy and create a least 3 functions in the API:
- function for getting graph templates and data queries
- function for creating graphs selected above
- function to insert foreign DS into Cacti

- Mathieu
mshook
Posts: 46
Joined: Mon May 02, 2005 3:33 pm
Location: New York, NY

Post by mshook »

bpawlik wrote:Thanks you mshook and rony for your thoughts and direction... I'll give the add_device.php script a go and see if that helps dissolve some of the work ahead of me! But I have to say the a CLI would really do the entire trick.
Yeah, I'm in the same boat... Don't think add_device.php will be of much help to you though...

- Mathieu
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Release of 0.9 expected late this summer.

As for API's, 0.9 will have a whole API system to allow for external developers to easily create intergrated applications/utilties with cacti.

If you would like to check out the progress of 0.9, just retrieve the MAIN branch in the cacti CVS.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest