| Cheshire Cat Computing http://steveshipway.org/forum/ |
|
| Switch Statement Not Working in Host Template. http://steveshipway.org/forum/viewtopic.php?f=34&t=5000 |
Page 1 of 1 |
| Author: | mmartin [ Wed Dec 14, 2011 10:33 am ] |
| Post subject: | Switch Statement Not Working in Host Template. |
| Author: | stevesh [ Wed Dec 14, 2011 5:02 pm ] |
| Post subject: | Re: Switch Statement Not Working in Host Template. |
Perl does not have a switch statement. You need to use an if/elsif/else construction instead. If you have it working in a separate script it may be because you have a differnet version of perl, or have some other libraries installed. |
|
| Author: | mmartin [ Thu Dec 15, 2011 3:32 am ] |
| Post subject: | Re: Switch Statement Not Working in Host Template. |
Hey Steve, thanks for your reply. Yea that's what I figured... Does MRTG run off it's own version/implementation of Perl? Because I noticed cfgmaker has the line "require 5.005;"? But the server has Perl v5.8.8, which according to Perldoc ("") does use a switch..? But anyway, I'll just use the If Statement instead. Thanks for the insight... Thanks Again, Matt |
|
| Author: | mmartin [ Thu Dec 15, 2011 9:17 am ] |
| Post subject: | Re: Switch Statement Not Working in Host Template. |
| Author: | stevesh [ Thu Dec 15, 2011 12:03 pm ] |
| Post subject: | Re: Switch Statement Not Working in Host Template. |
Calculated Target lines are possible, though you MUST surround operators with spaces and they MUST be 2-item records or constants. Use the dummy OID, 'pseudoZero' to mean a zero. EG: Target[foo]: ( oid1&oid2:community@device - oid3&pseudoZero:community@device ) * 1024 Note that though the cfgmaker script requres perl of at least v5.5, 5.8 is fine. However your web server might be using embedded perl that is not v5.8.8? Also the switch statement I found for perl 5.8 is in a separate module, not in the base. |
|
| Author: | stevesh [ Thu Dec 15, 2011 12:04 pm ] |
| Post subject: | Re: Switch Statement Not Working in Host Template. |
You may like to read this about use of Perl switch statements and equivalent: http://www.misc-perl-info.com/perl-switch.html |
|
| Author: | mmartin [ Fri Dec 16, 2011 4:09 am ] |
| Post subject: | Re: Switch Statement Not Working in Host Template. |
| Author: | mmartin [ Fri Dec 16, 2011 5:37 am ] |
| Post subject: | Re: Switch Statement Not Working in Host Template. |
| Page 1 of 1 | All times are UTC + 12 hours [ DST ] |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|