Hello,
We monitor many switches with nagiosXI,
We are doing some changes on our network and will modify some switches IPs.
If I change the IP for the host within the CCM, the change will not apply to it's services ( ports ) then my dashbord won't be accurate and all.
Is there a way to change the IP in the services configuration ?
I looked into the bulk modification tool but I'm not sure it is what I need, or maybe I do not understant how I can do it with that tool.
Thanks !
change switch IP
Re: change switch IP
The easiest way would be to remove/readd it with the switch wizard again.
If you really want to redo them, this would be the process:
You would need to do four things:
1. Modify the host in Configure > Core Config Manager > Hosts.
2. Rename the files in /var/lib/mrtg:
- Change all occurrences of X.X.X.X to the old IP, change all occurrences of Y.Y.Y.Y to the new IP
3. Modify the MRTG config file for the switch in /etc/mrtg/conf.d for the device as well to change the IP.
- Change all occurrences of X.X.X.X to the old IP, change all occurrences of Y.Y.Y.Y to the new IP
4. Update the bandwidth services to change the $ARG1$ value from:
To:
You can either do that manually or do something like this then apply config:
- Change all occurrences of X.X.X.X to the old IP, change all occurrences of Y.Y.Y.Y to the new IP
NOTE: BEFORE YOU RUN THIS, MAKE SURE YOU HAVE AN XI BACKUP as directly interacting with the DB can cause issues if you're not very careful with the commands.
Note: You can always revert to a config snapshot in Admin > Config Snapshot if you have any issues.
If you really want to redo them, this would be the process:
You would need to do four things:
1. Modify the host in Configure > Core Config Manager > Hosts.
2. Rename the files in /var/lib/mrtg:
- Change all occurrences of X.X.X.X to the old IP, change all occurrences of Y.Y.Y.Y to the new IP
Code: Select all
rename X.X.X.X Y.Y.Y.Y /var/lib/mrtg/*.rrd- Change all occurrences of X.X.X.X to the old IP, change all occurrences of Y.Y.Y.Y to the new IP
Code: Select all
sed -i 's/X.X.X.X/Y.Y.Y.Y/g' /etc/mrtg/conf.d/X.X.X.X.cfgCode: Select all
X.X.X.X_ZZZZ.rrdCode: Select all
Y.Y.Y.Y_ZZZZ.rrd- Change all occurrences of X.X.X.X to the old IP, change all occurrences of Y.Y.Y.Y to the new IP
NOTE: BEFORE YOU RUN THIS, MAKE SURE YOU HAVE AN XI BACKUP as directly interacting with the DB can cause issues if you're not very careful with the commands.
Code: Select all
mysql -h 127.0.0.1 -uroot -pnagiosxi nagiosql -e 'UPDATE tbl_service SET check_command = REPLACE(check_command, "X.X.X.X", "Y.Y.Y.Y") WHERE check_command LIKE "%X.X.X.X_%.rrd%";'-
MelsStudios
- Posts: 19
- Joined: Thu May 07, 2020 9:28 am
Re: change switch IP
Thanks for you solutions,
I have many dashboards for many users, If I remove / re-add with the switch wizard, will the dashboard get updated with the new IP ? or I will have to re-do every dashboards ?
Thanks !
I have many dashboards for many users, If I remove / re-add with the switch wizard, will the dashboard get updated with the new IP ? or I will have to re-do every dashboards ?
Thanks !
Re: change switch IP
I think it would only impact it if you also change the hostname (instead of just the address).
If you change hostname or servicename it will impact the historical data and dashboards.
If you change hostname or servicename it will impact the historical data and dashboards.
-
MelsStudios
- Posts: 19
- Joined: Thu May 07, 2020 9:28 am
Re: change switch IP
All right, Thank you for your help,
that answered my question.
that answered my question.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: change switch IP
Hello @MelsStudios,
Glad we could help. We'll close this thread out. Feel free to open another if you have any new questions.All right, Thank you for your help,
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!