HELP -easy perl script-

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rambaldi85
Posts: 1
Joined: Sun Nov 02, 2014 10:43 am

HELP -easy perl script-

Post by rambaldi85 »

Hi, can someone help me to create a easy Pers or Shell script to make the same like:

check_snmp -H $HOSTADDRESS$ -o 1.3.6.1.4.1.6302.2.1.2.2.0 -C public -u mV -l OutPower -w 48000:40000 -c 39999:0

BUT the Outpower must be in V (not in mV like the Output from the check_snmp plugin)
I neet a 1:1000 Output

THANKS:)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: HELP -easy perl script-

Post by tmcdonald »

Can you show us an example of the script being run from the command line and the output it currently shows?
Former Nagios employee
User avatar
rhassing
Posts: 412
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: HELP -easy perl script-

Post by rhassing »

In perl you can easily divide your variable like this:

Code: Select all

$output_V=$output_mV/1000;
Rob Hassing
Image
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: HELP -easy perl script-

Post by abrist »

Thanks Rob!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked