Update hostname automatically in Graphs

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

Moderators: Developers, Moderators

Post Reply
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Update hostname automatically in Graphs

Post by niranga1127 »

Hi,

I'm using Version 1.2.23
i have added around 30000 devices to the cacti using automation rules.
But some of the hostnames of the devices are changing time to time. How can i update this in graph names ?
Graph name for format --
|host_description| - Traffic - |query_ifName| - |query_ifAlias|

Regards
Niranga
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Update hostname automatically in Graphs

Post by macan »

niranga1127 wrote: Tue Jan 16, 2024 3:13 am Hi,

I'm using Version 1.2.23
i have added around 30000 devices to the cacti using automation rules.
But some of the hostnames of the devices are changing time to time. How can i update this in graph names ?
Graph name for format --
|host_description| - Traffic - |query_ifName| - |query_ifAlias|

Regards
Niranga
Set correct graph name format in templates -> graph and data sources.
Go to console -> management -> graphs -> select graphs with wrong name and below "Reaplly suggested names". The same for data source
Let the Cacti grow!
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

I tried this method. But it doesnt work :(
I didnt change any graph template . Graph/data source template have already set correctly
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

However after running reapply suggested names , it automatically remove the interface name.
When i add graphs initially with automation rules , it was added correctly with given format. So there cannot be any issue with graph template

Kindly help me on this....!1
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Update hostname automatically in Graphs

Post by macan »

Set correct graph name format in templates -> graph and data sources
Reapply suggested names uses format from graph template, so you have to change it
Let the Cacti grow!
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

I tried your method by setting graph template but it didnt work
hostname didnt change
Hostname under Console --> devices name cannot be changed automatically right ?
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

Anyone can help me on this ?
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

Any update on this
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Update hostname automatically in Graphs

Post by macan »

I'm confused now. You talked about hostname but in your graph name is host_description.
You can use both, check https://docs.cacti.net/Variables.md (find Host Variables article)
Let the Cacti grow!
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

Hi,

Sorry, If i made a mistake. i want to change hostname description

Regards
Niranga
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

I ran php -q poller_graphs_reapply_names.php -id=2 -d command to specific router and after that ifAlias dissappeared.
I tried changing the graph template by adding space and tried this script again. it doesnt work
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Update hostname automatically in Graphs

Post by macan »

could you the same thing on 1.2.26?
Let the Cacti grow!
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

you mean i need to update cacti version to 1.2..26 ?
I m not sure thats possible at the moment
I have like 30000 graphs running
User avatar
macan
Cacti Guru User
Posts: 1137
Joined: Tue Mar 18, 2008 2:30 am
Location: Czech

Re: Update hostname automatically in Graphs

Post by macan »

so try to install small new 1.2.26 and test
Let the Cacti grow!
niranga1127
Posts: 26
Joined: Mon Apr 03, 2023 6:10 am

Re: Update hostname automatically in Graphs

Post by niranga1127 »

Hi,

I think i may have found the issue here but i dont knw how to fix it.
When i Go to Console --> Devices --> Select device --> run SNMP interface statistics verbose query. I see below output
Image
Attachments
Screenshot_15.png
Screenshot_15.png (57.96 KiB) Viewed 826 times
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests