
FishMonger
Veteran
/ Moderator
Mar 5, 2014, 2:54 PM
Post #8 of 9
(4128 views)
|
Re: [sh.ajay12] how to understand nagios plugins
[In reply to]
|
Can't Post
|
|
Did you read the info in the page that Kenosis pointed you 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. http://search.cpan.org/~jv/Getopt-Long-2.42/lib/Getopt/Long.pm 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. http://shop.oreilly.com/product/0636920018452.do IMO, the script wasn't written very well, so trying to understand what it does will take some work/effort.
|