Build precise queries to find exactly what you need
Press ESC to close
I really like the regex of it all. Searches most things. But I have found that when the host alias is missing it does not work properly.
Also the search does a grep -A INT so if the configuration is less default and places the grep’ed variable outside of the lookahead it will fail also. example: grep -EA2 “define[ ]+host[ ]+” /path/to/objects.cache | grep -Eo “(host_name|alias).+” if alias is on position 3+ it will miss it.
Perhaps first grep all the required parameters and then split the ones you want. Something like below. example: grep “(host_name|alias|define[ ]+host[ ]+).+” |grep -EA2 “define[ ]+host[ ]+” /path/to/objects.cache | grep -Eo “(host_name|alias).+”
We’ve completely redesigned the world’s largest repository of Nagios plugins and monitoring tools. Join thousands of users sharing monitoring solutions for servers, applications, and everything in between.
Due to our redesign, all existing accounts require a password reset to access your account again.
Ready to explore 6,100+ projects and contribute to the community?
Reset Password Create Account
Happy Monitoring!