I was monitoring a Cisco switch with Nagios XI, and I later had to change the IP address of the switch. Is there a way to reflect the address change without deleting and re-adding the switch to Nagios? I don't want to lose all the configuration settings I had made for all the ports.
Thanks,
Leanne
Address change on switch
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Address change on switch
Unfortunately there isn't an easy way to do this.
Best I could come up with would be the following:
** This will lose your historical data. **
Make a backup of your /etc/mrtg/mrtg.cfg
download that file and do a find/replace on the IP address.
replace with your edited file.
Download the particular config from
/usr/local/nagios/etc/services/
do a find/replace on the IP address
change the filename to the new address
Do the same for the particular config from
/usr/local/nagios/etc/hosts
Create a directory like
/usr/local/nagios/etc/newconfig
place both of these files in there.
In the Web interface go to Configure -> Core Config Manager -> Import Config Files
SELECT ONLY the two files you put in /usr/local/nagios/etc/newconfig
Click Import
Apply Configuration.
Once working delete the old one.
Best I could come up with would be the following:
** This will lose your historical data. **
Make a backup of your /etc/mrtg/mrtg.cfg
download that file and do a find/replace on the IP address.
replace with your edited file.
Download the particular config from
/usr/local/nagios/etc/services/
do a find/replace on the IP address
change the filename to the new address
Do the same for the particular config from
/usr/local/nagios/etc/hosts
Create a directory like
/usr/local/nagios/etc/newconfig
place both of these files in there.
In the Web interface go to Configure -> Core Config Manager -> Import Config Files
SELECT ONLY the two files you put in /usr/local/nagios/etc/newconfig
Click Import
Apply Configuration.
Once working delete the old one.