Perl_Pursuer has asked for the wisdom of the Perl Monks concerning the following question:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NNM Nonsense
by cengineer (Pilgrim) on Aug 09, 2007 at 15:42 UTC | |
| [reply] |
by Perl_Pursuer (Initiate) on Aug 09, 2007 at 20:23 UTC | |
| [reply] [d/l] |
by bart (Canon) on Aug 10, 2007 at 00:21 UTC | |
snmpget $device .1.3.6.1.2.1.2.2.1.2.$interfacePerl is not a shell script interpreter. Assuming this is a command line for a program you need to call, you need to make it a string, and actually execute it, either by system or by backticks(``) or qx. Plus, it needs a semicolon between statements. So, start by changing this line to or depending on what you want to do with the output. I don't know this particular protocol so you'll probably have to tweak it some more before it actually becomes usable. | [reply] [d/l] [select] |
by graff (Chancellor) on Aug 10, 2007 at 04:14 UTC | |
It's checking two regex matches, but there should be an "and" or "or" (or && or ||) between them -- or else there should be only one regex test. (Do you know what the intention is there? I don't.) Then this line just after the lengthy comment is obviously bad: You're missing a comma before "NODE_DOWN", and you have an odd number of quotation marks. (You could actually get rid of all the double-quotes in that line except for the ones around "NODE_DOWN", but you need the missing comma.) Running the script without fixing those (and the line pointed to by bart) will just generate a bunch of syntax errors. Is that what you meant by "I cannot get this to work correctly"? Or did you make mistakes in posting your code, and the version you're actually running has some other problem(s)? | [reply] [d/l] [select] |