Applying config takes forever when perfdata stored on NetApp
Posted: Thu Nov 02, 2017 8:54 pm
My setup is a little bit odd because I have a NetApp that I want to use to expose an NFS mount that is shared between multiple servers to store the perfdata without risking losing that valuable intellectual property in the event of a Nagios server failure. When you do a stock install of Nagios XI and shift the performance data over to an NFS volume on a NetApp, odds are good you'll start seeing exorbitant times when applying configuration.
The reason why this happens is because part of the scripting that executes attempts to change ownership on the nagios controlled directories (which includes the perfdata folder.) By default (at least here), NetApp volumes have SnapMirroring turned on, which exposes a folder named ".snapshot" in each folder in the volume to keep track of changes as they happen. This is great if you end up corrupting a file and need to roll back, but darn annoying if you're having to wait forever when applying configuration.
I found two solutions to this.
I'll start with the better of the two (but not the one I'm using yet.) You can disable the visibility of the SnapMirror folder to clients so that the snapshots are still taken but not visible to the client machine. The steps are pretty simple to follow and can be found here: https://library.netapp.com/ecmdocs/ECMP ... 95F07.html.
Now, for the more hacky way to do it. If your storage administrators either refuse to make that change (this is the boat I'm in, thanks storage guys!
) or want to test extensively before rolling to production, you can work around the issue by editing the file (/usr/local/nagiosxi/scripts/export_nagiosql.sh.)
Comment out the following lines:
#sudo $BASEDIR/reset_config_perms.sh
#error handling
#ret=$?
#if [ $ret -gt 0 ]; then
# echo "RESETTING CONFIG PERMS FAILED!\n"
# exit 4
#fi
Now, before the forum gods strike me down for heresy, I would HIGHLY recommend that you also setup some sort of cronjob to keep the permissions in check as it really is important that all of the permissions are setup properly. Another tidbit is that you'll have to do this every time you upgrade NagiosXI since this is a file that is included with the upgrades.
While this is not an optimal solution by any means, it does certainly circumvent the problem at hand.
Hope this helps someone!
The reason why this happens is because part of the scripting that executes attempts to change ownership on the nagios controlled directories (which includes the perfdata folder.) By default (at least here), NetApp volumes have SnapMirroring turned on, which exposes a folder named ".snapshot" in each folder in the volume to keep track of changes as they happen. This is great if you end up corrupting a file and need to roll back, but darn annoying if you're having to wait forever when applying configuration.
I found two solutions to this.
I'll start with the better of the two (but not the one I'm using yet.) You can disable the visibility of the SnapMirror folder to clients so that the snapshots are still taken but not visible to the client machine. The steps are pretty simple to follow and can be found here: https://library.netapp.com/ecmdocs/ECMP ... 95F07.html.
Now, for the more hacky way to do it. If your storage administrators either refuse to make that change (this is the boat I'm in, thanks storage guys!
Comment out the following lines:
#sudo $BASEDIR/reset_config_perms.sh
#error handling
#ret=$?
#if [ $ret -gt 0 ]; then
# echo "RESETTING CONFIG PERMS FAILED!\n"
# exit 4
#fi
Now, before the forum gods strike me down for heresy, I would HIGHLY recommend that you also setup some sort of cronjob to keep the permissions in check as it really is important that all of the permissions are setup properly. Another tidbit is that you'll have to do this every time you upgrade NagiosXI since this is a file that is included with the upgrades.
While this is not an optimal solution by any means, it does certainly circumvent the problem at hand.
Hope this helps someone!