Help: Automating Router Interface Changes
Moderators: Developers, Moderators
Help: Automating Router Interface Changes
I work for an ISP and am currently working on migrating from our current Cricket system to Cacti. So far I'm extremely impressed by what Cacti can do verses Cricket, and was very pleased to have figured out that Cacti will do everything that our current Cricket systems does, plus much, much more.
The only thing that I can't seem to figure out how to do is to figure out how to automate the updates of router interfaces on Cacti. We have a small number of core routers (read 4-5) with a few main physical interfaces and up to 300 sub-interfaces to each of our customers. Each (sub)interface has an ifAlias associated with it that we use to keep track of the customer’s information (ie. Customer’s name, provisioned local loop bandwidth and circuit ID numbers), and this information tends to updated on the router’s side fairly regularly, and we obviously have interfaces that get decommissioned and new ones that are provisioned also on a fairly regular basis. So it becomes a bit tedious to have to be constantly updating our monitoring system to reflect these changes instead of just updating the router config.
On our current Cricket system, we simply run a cron script every night that runs a doctored version of the genRtrConfig script on each router to update the config tree so that any changes to the router interfaces are reflected.
Does anyone know of a similar procedure I can follow to do this for me in Cacti? Or will it boil down to me writing my own script to walk the router and update the database?
Any help with this is much appreciated.
--
Chris
The only thing that I can't seem to figure out how to do is to figure out how to automate the updates of router interfaces on Cacti. We have a small number of core routers (read 4-5) with a few main physical interfaces and up to 300 sub-interfaces to each of our customers. Each (sub)interface has an ifAlias associated with it that we use to keep track of the customer’s information (ie. Customer’s name, provisioned local loop bandwidth and circuit ID numbers), and this information tends to updated on the router’s side fairly regularly, and we obviously have interfaces that get decommissioned and new ones that are provisioned also on a fairly regular basis. So it becomes a bit tedious to have to be constantly updating our monitoring system to reflect these changes instead of just updating the router config.
On our current Cricket system, we simply run a cron script every night that runs a doctored version of the genRtrConfig script on each router to update the config tree so that any changes to the router interfaces are reflected.
Does anyone know of a similar procedure I can follow to do this for me in Cacti? Or will it boil down to me writing my own script to walk the router and update the database?
Any help with this is much appreciated.
--
Chris
Here is a quick and dirty method to doing it. Just so we're on the same page:
- Click on 'Console' then 'Devices' then select your device.
- To the far right of 'SNMP - Interface Statistics' there is a green circle. This will manually query_reload your device.
If you take a look at the URL when you hover over the green circle, it is doing a call to 'http://www.example.com/cacti/hosts.php? ... st_id=1678'
'action' is straight forward
'id' is the Data Query you want to reload (in most cases, SNMP, or '1')
'host' is the host id number
What you can do is create a modified 'hosts.php' file, somewhere outside of your web root, that does not require authentication to function, and call it with a wget, passing the variables as per the URL above.
- Click on 'Console' then 'Devices' then select your device.
- To the far right of 'SNMP - Interface Statistics' there is a green circle. This will manually query_reload your device.
If you take a look at the URL when you hover over the green circle, it is doing a call to 'http://www.example.com/cacti/hosts.php? ... st_id=1678'
'action' is straight forward
'id' is the Data Query you want to reload (in most cases, SNMP, or '1')
'host' is the host id number
What you can do is create a modified 'hosts.php' file, somewhere outside of your web root, that does not require authentication to function, and call it with a wget, passing the variables as per the URL above.
--
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
Live fast, die young
You're sucking up my bandwidth.
J.P. Pasnak,CD
CCNA, LPIC-1
http://www.warpedsystems.sk.ca
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
Also, in 0.8.6h, there is a handy utility in the root of your Cacti web site called:
poller_reindex_hosts.php
If you run that script once a night, you will get the same effect. Run it using "php poller_reindex_hosts.php -h" once to figure the syntax.
TheWitness
poller_reindex_hosts.php
If you run that script once a night, you will get the same effect. Run it using "php poller_reindex_hosts.php -h" once to figure the syntax.
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?
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?
- TheWitness
- Developer
- Posts: 17007
- Joined: Tue May 14, 2002 5:08 pm
- Location: MI, USA
- Contact:
lol...
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?
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?
Thanks guys, I actually saw that script yesterday and wondered if that was what it did. Just to make sure it does what I want it to do, will this script add new interfaces that appear, and remove ones that no longer exist, as well as update the ifAlias tags? Or will I still need to manually add/delete interfaces from Cacti?
I think I've already asked this question elsewhere - but where/how do you add ifAlias?Linegod wrote:The script only re-indexes the hosts - updates names, ifAlias, etc. It will not add or remove graphs.
In "Data Queries -> SNMP - Interface Statistics -> In/Out Bits with Total Bandwidth" I don't see how to add ifAlias to the "Suggested Values" list.
At our company, we need to do the same thing but with ifName instead of ifAlias. So instead of an off-line reply, could we get a public summary? An example that lists only the things that differ from the "Interface - Traffic" graph template would be really useful.cpedro wrote:Check your PMsknobdy wrote:I don't think I'm following you... can you give more specifics - off-line perhaps?
Thanks,
Joshua
Dear jkeroes,
You can go to Data Queries from console ,then SNMP - Interface Statistics ,In/Out Bits:
Under Data Template - Interface - Traffic
put |host_description| - Traffic - |query_ifAlias| - |query_ifName| on the left hand box and title on the right one press add
then you have to move them to the top and save
For the title beeing appear on graph edit Graph Template - Interface - Traffic (bits/sec)
write |host_description| -|query_ifIndex| - |query_ifAlias| - |query_ifName| on the left box and title on the right one...press add
then move the entry to the top
I made that modification to In/Out Bits (64-bit Counters)
as attached ,you can import that XML
You can go to Data Queries from console ,then SNMP - Interface Statistics ,In/Out Bits:
Under Data Template - Interface - Traffic
put |host_description| - Traffic - |query_ifAlias| - |query_ifName| on the left hand box and title on the right one press add
then you have to move them to the top and save
For the title beeing appear on graph edit Graph Template - Interface - Traffic (bits/sec)
write |host_description| -|query_ifIndex| - |query_ifAlias| - |query_ifName| on the left box and title on the right one...press add
then move the entry to the top
I made that modification to In/Out Bits (64-bit Counters)
as attached ,you can import that XML
- Attachments
-
- cacti_graph_template_interface_traffic_bitssec_64_counter.xml
- (14.09 KiB) Downloaded 143 times
Who is online
Users browsing this forum: No registered users and 0 guests