OS version of monitored system:
AIX 7.2 - Technology Level 5 - Service Pack 8 (7200-05-08-2420)
Description of the problem :
Every night, when the backup software named rubrik does its work it does not unmount nfs-mounts on the AIX system before removing or disabling access to the share on the backup server. Rubrik creates many stale shares this way at the same time. This leads into timeouts in the section_df and section_nfs_mounts from the agent.
Steps to reproduce:
Create many nfs shares
Mount them on AIX
Prevent the access to the nfs server (e.g. on osi layer 3 by droping nfs related traffic by a firewall rule on the nfs server) to get a stale nfs mounts on AIX
Run the agent
If profiling is enabled you will find that the sections of df and nfs_mounts needs too long so the agent will cause a timeout on the server. This leads to a critical ‘Check_MK’ service.
As soon you enable access to the nfs share again, the agent comes back.
Question:
Is it possible to run internal sections of the agent asynchronous without modifying the agents code?
(as already described in AIX agent and hard mounted NFS shares)
In other words, is there a chance to create a config-file e.g. in /etc/check_mk/… to do so?
If you have only the internal df available you will have no chance to avoid the timeout problem. With the extra df command there are the same excludes defined as on Linux.
The ‘_unused’ modification prevents the agent to use the /opt/freeware/bin/df which is some kind of ‘unteachable’ in this way, so the ‘else’ is used instead.
The ‘-T local’ is exactly what we need at this place. The ‘grep -v :’ at the end is most probably way of unnecessary.
The nfs section i modified this way:
section_nfs_mounts() {
# Check for hanging NFS mounts. This needs a GNU stat installed in the PATH
json_templ() {
echo '{"mountpoint": "'"${1}"'", "source": "'"${2}"'", "state": "ok", "mount_seems_okay": "true"}'
}
json_templ_empty() {
echo '{"mountpoint": "'"${1}"'", "source": "'"${2}"'", "state": "hanging", "mount_seems_okay": "false"}'
}
if inpath stat; then
echo '<<<nfsmounts_v2:sep(0)>>>'
mount | grep ' nfs' | grep -v -e rubrik -e unwanted_2 -e unwanted_3 -e etc_etc_etc | while read -r HN MD MP _; do
waitmax 2 stat -f -c "'$(json_templ "${MP}" "${HN}:${MD}")'" "${MP}" || json_templ_empty "${MP}" "${HN}:${MD}"
done
echo '<<<cifsmounts>>>'
mount | grep ' cifs' | while read -r _ _ MP _; do
if [ ! -r "${MP}" ]; then
echo "${MP} Permission denied"
else
waitmax 2 stat -f -c '"'"${MP}"' ok - - - -"' "${MP}" ||
echo "${MP} hanging 0 0 0 0"
fi
done
fi
}
As you can see i have simply inserted a ‘| grep -v -e unwanted_mountpoint’ statement
These two modification should be enough, but - again - this is not update save. I wish there would be an option to configure sections run asyncronously in the background instead of disabling them in /etc/check_mk/exclude_sections.cfg or modifying the agent every time a new one is created by the cmk devs.
Perhaps this find a way to a further version of cmk
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.