|
|
| Author |
Message |
melanie_pfefer
Joined: 27 Feb 2008 Posts: 5
|
Posted: Thu Feb 28, 2008 2:52 am Post subject: |
|
|
Hello
So I understand from you that 0.8.7 has the scripts that can add 150 hosts + their graphs in one shot. True?
actually I am trying to find an automatic way to add 150 hosts + their graphs. I need to know how to do it in cacti without manually adding these hosts and graphs in the web interface.
thanks |
|
| Back to top |
|
 |
BSOD2600 Cacti Moderator
Joined: 08 May 2004 Posts: 6876 Location: WA, USA
|
Posted: Thu Feb 28, 2008 2:36 pm Post subject: |
|
|
| melanie_pfefer wrote: | | So I understand from you that 0.8.7 has the scripts that can add 150 hosts + their graphs in one shot. True? |
yes |
|
| Back to top |
|
 |
Rael Cacti User
Joined: 05 Apr 2007 Posts: 128
|
Posted: Wed Apr 02, 2008 9:14 am Post subject: |
|
|
| These tools have proved a god send for the long term support of our cacti instance, however I don't see a way of removing hosts from cacti in the cli? Am I missing something? |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Thu Apr 03, 2008 2:05 pm Post subject: |
|
|
What are you aiming add when talking about "moving". What do you want to move?
Reinhard |
|
| Back to top |
|
 |
Rael Cacti User
Joined: 05 Apr 2007 Posts: 128
|
Posted: Mon Apr 07, 2008 8:50 am Post subject: |
|
|
| I'm sorry gandalf, we're you talking to me or someone else? |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Wed Apr 09, 2008 12:18 pm Post subject: |
|
|
| Rael wrote: | | I'm sorry gandalf, we're you talking to me or someone else? | I was talking to you, but I must have been drunk. I was reading "moving" instead of "removing".
So it's simply a matter of a feature request. Not that difficult
Reinhard |
|
| Back to top |
|
 |
ibrahim
Joined: 27 May 2008 Posts: 27
|
Posted: Mon Jun 09, 2008 10:43 am Post subject: |
|
|
hello Reinhard
i have a list of hosts that i have to monitor. can you please tell me how to use this script ( after i installed it in the cacti dir ) in order to insert those hosts with their graphs automatically ( by steps)
i ll really appreciate
thx in advance |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Wed Jun 11, 2008 2:31 pm Post subject: |
|
|
Please see http://docs.cacti.net/node/529
There have been some contributions of wrapper scripts around those cacti cli stuff. Please search the forum for them
Reinhard |
|
| Back to top |
|
 |
killshoot
Joined: 26 Mar 2008 Posts: 35
|
Posted: Tue Jun 17, 2008 7:42 am Post subject: |
|
|
@Gandalf
I've used these scripts to insert my 2000 appliances into cacti.
I've also make a quick dirty script to automake threshold.
But I can't find a solution to automatically delete grapgh in the same way that we create it ( specifying interface if oper status = down for exemple ).
Can you help me? Which php file is used to delete graph with wich parameter?
Best regards,
Vince |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Wed Jun 18, 2008 1:21 pm Post subject: |
|
|
Please use the cli scripts provided by cacti since 087
Reinhard |
|
| Back to top |
|
 |
killshoot
Joined: 26 Mar 2008 Posts: 35
|
Posted: Thu Jun 19, 2008 5:43 am Post subject: |
|
|
@Gandalf
I've used the script provided in release 0.87.
But there is no script to delete graph. In fact I don't want to create a graph for vlan interface even if operstatus=up.
So what I currently do is create all graph with operstatus=up and after deleting all graph that I don't need.
My goal is to have a script that can delete graph according to the ifdescr value.
Thank you for your help |
|
| Back to top |
|
 |
rujipars
Joined: 02 Nov 2007 Posts: 15
|
Posted: Fri Jun 20, 2008 6:04 am Post subject: |
|
|
As I can see, the speed of unrouted vlan is 0. Can we add filtering by ifSpeed when create graph? At least we can reduce unwanted process to create unrouted vlans that appear as interfaces.
Looking carefully into the ifType code may also help to gain more precise filtering.
I don't have 0.8.7 at hand but like to offer an idea that may help. (I'm using cisco) |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Sat Jun 21, 2008 2:49 pm Post subject: |
|
|
Automatic filtering is not (yet) provided by cacti. But when scanning the interface list manually, you'll notice those with correct ifSpeed. Then, please select only those
Reinhard |
|
| Back to top |
|
 |
TheBigOne
Joined: 29 Sep 2008 Posts: 33 Location: Basel
|
Posted: Tue Oct 14, 2008 4:53 am Post subject: |
|
|
Hi, my problem was to add new graphs associated to a host template after adding the device with add_device.php.
I added some dirty lines to the add_graph.php to get all graph template ids associated to a special host template. After getting theese ids its easy to add theese graphs.
I use it in combination with a shell script so all i need is the output of the ids.
Of course there is a workaround getting all ids but this was for me the easiest way.
Hope this is useful for someone.
this must be added into the switch
| Code: |
break;
case "--list-graph-template-id":
$listGraphTemplateID = TRUE;
|
this can be added somewhere in the file (its really dirty )
| Code: |
if ($listGraphTemplateID) {
if ($hostTemplateId > 0) {
function displayGraphTemplateIDs($hostTemplateId) {
$ids = array();
$tmparray = db_fetch_assoc("SELECT graph_template_id FROM host_template_graph WHERE host_template_id = $hostTemplateId");
foreach ($tmparray as $tmp) {
$tmp["graph_template_id"];
$ids[] = $tmp["graph_template_id"];
echo $tmp["graph_template_id"]."\n";
}
return $ids;
}
displayGraphTemplateIDs($hostTemplateId);
} else {
echo "ERROR: You must supply an host-template-id before you can list its graph templates\n";
echo "Try --host-template-id=[ID] --list-graph-template-id\n";
exit(1);
}
exit(0);
}
|
this can be added to the display_help() function
| Code: | | echo " --list-graph-template-id --host-template-id=[ID]\n"; |
if you execute now
| Code: | | ./add_graphs.php --host-template-id=14 --list-graph-template-id |
the output looks like:
13
30
31
42
thats a snipped of my shell code
| Code: |
ids=`php -q ../cli/add_graphs.php --list-graph-template-id --host-template-id=$solarisID`
for a in $ids
do
php -q ../cli/add_graphs.php --host-id=$hostID --graph-type=cg --graph-template-id=$a
done
|
EDIT// feature request created
Last edited by TheBigOne on Wed Oct 15, 2008 2:49 am; edited 1 time in total |
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12604 Location: Muenster, Germany
|
Posted: Tue Oct 14, 2008 1:43 pm Post subject: |
|
|
Please create a feature request using http://ww.cacti.net/bugs.php adding your code there
Reinhard |
|
| Back to top |
|
 |
|