Mar 5, 2014, 2:54 PM
Post #8 of 9
Did you read the info in the page that Kenosis pointed you to?
Re: [sh.ajay12] how to understand nagios plugins
[In reply to]
It covers each of the option parameters and tells you what they are used for.
The script uses the Getopt::Long module to parse the command options and assigns the vars. If you want to know how that module works, you'll want to read its documentation.
To understand the script, you'll need to read the code. Start at the top and work through it a few lines at a time. when you get to a section that you don't understand, ask a specific question about that portion.
You can also step through the script using the perl debugger to see it in action.
Since you didn't understand the basic var assignments at the beginning, I might suggest that you start by picking up a good beginner level perl book before diving into this script.
IMO, the script wasn't written very well, so trying to understand what it does will take some work/effort.