You will need perl

######################################################################
# System: APC Environmental Monitor
# Description: 
######################################################################
Target[apc.temp]: `perl c:\mrtg\bin\gettemp.pl 100.100.100.100 SNMPCommunity`
#Target[apc.temp]: 
1.3.6.1.4.1.318.1.1.2.1.1.0&1.3.6.1.4.1.318.1.1.2.1.2.0:[EMAIL PROTECTED] 
Directory[apc.temp]: APC.Temp
MaxBytes[apc.temp]: 100
unscaled[apc.temp]: dwmy
options[apc.temp]: noinfo, gauge, unknaszero, nobanner, nopercent, printrouter, 
pngdate
Title[apc.temp]: NOC Temperature & Humidity
PageTop[apc.temp]: NOC Temperature & Humidity</H1>
YLegend[apc.temp]: % Hum / Deg F
ShortLegend[apc.temp]: . 
Legend1[apc.temp]: % Relative Humidity
Legend2[apc.temp]: Temperature in ºF
Legend3[apc.temp]: Maximal 5 Minute Humidity
Legend4[apc.temp]: Maximal 5 Minute Temperature
LegendI[apc.temp]: NOC Humidity %
LegendO[apc.temp]: NOC Temp in ºF 

Here is the gettemp.pl script

use BER;
use SNMP_Session;
 
$host = $ARGV[0];
$community = $ARGV[1];
 
$session = SNMP_Session->open ($host, $community, 161)
    || die "Can't open SNMP session";
 
$temp = encode_oid(1,3,6,1,4,1,318,1,1,2,1,1,0);  
$humidity = encode_oid(1,3,6,1,4,1,318,1,1,2,1,2,0);
$sysname = encode_oid(1,3,6,1,2,1,1,5,0);   
$sysUptime = encode_oid(1,3,6,1,2,1,1,3,0);
 

 
#printf "get Temp\n";
$session->get_request_response ($temp);
($bindings) = $session->decode_get_response ($session->{pdu_buffer});
($binding,$bindings) = &decode_sequence ($bindings);
($temp,$tempvalue) = &decode_by_template ($binding, "%O%@");
#printf "returned %.0f\n", &pretty_print ($tempvalue);

#printf "get Humidity\n";
$session->get_request_response ($humidity);
($bindings) = $session->decode_get_response ($session->{pdu_buffer});
($binding,$bindings) = &decode_sequence ($bindings);
($humidity,$humidityvalue) = &decode_by_template ($binding, "%O%@");
#printf "returned %.0f\n", &pretty_print ($humidityvalue);

$adjtemp = &pretty_print ($tempvalue) * 9 / 5 + 32;

$session->get_request_response ($sysname);
($bindings) = $session->decode_get_response ($session->{pdu_buffer});
($binding,$bindings) = &decode_sequence ($bindings);
($sysname,$sysnamevalue) = &decode_by_template ($binding, "%O%@");
$session->get_request_response ($sysUptime);
($bindings) = $session->decode_get_response ($session->{pdu_buffer});
($binding,$bindings) = &decode_sequence ($bindings);
($sysUptime,$sysUpvalue) = &decode_by_template ($binding, "%O%@");
 

print &pretty_print($humidityvalue),"\n";
print "$adjtemp","\n";
print &pretty_print($sysUpvalue),"\n";
print &pretty_print($sysnamevalue),"\n";
 
exit (0);


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Josh
Sent: Wednesday, May 04, 2005 7:56 AM
To: [EMAIL PROTECTED]
Subject: [mrtg] APC Environmental Monitor

Has anyone had any success with graphing the Temp/RH on the APC Environmental 
Monitoring Unit (AP9319)? 
Here's a better description of the model:
http://www.apc.com/products/family/index.cfm?id=47

I've done an snmpwalk on the thing and can't find anything providing the temp 
or RH.

If anyone has accomplished this on this unit can you post (or send me) a sample 
configuration file?  I've seen a lot of posts on getting this information from 
APC UPS's but not specifically this Environmental Monitoring Unit.

If you need any more details I can provide them. 
Thanks.

-Josh

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--
Unsubscribe mailto:[EMAIL PROTECTED]
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi 

Bear Technologies Corporation
Yogi Yeager 
President 
1410 Summit Ave, Suite 6
Plano, TX 75074
972.424.7086
Fax - 972.379.4929
www.BearTech.com
LAN / WAN Network Services
Internet Service Provider

Message from: [EMAIL PROTECTED]
Message to: [EMAIL PROTECTED]
Attached files: 0
Attached files size: 0 

This message (and any associated files) is intended only for the use of the 
individual or entity to which it is addressed and may contain information that 
is confidential, subject to copyright or constitutes a trade secret. If you are 
not the intended recipient you are hereby notified that any dissemination, 
copying or distribution of this message, or files associated with this message, 
is strictly prohibited. If you have received this message in error, please 
notify us immediately by replying to the message and deleting it from your 
computer. Messages sent to and from Bear Technologies may be monitored. 

Internet communications cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. Therefore, we do not accept responsibility for 
any errors or omissions that are present in this message, or any attachment, 
that have arisen as a result of e-mail transmission. If verification is 
required, please request a hard-copy version. Any views or opinions presented 
are solely those of Yogi Yeager and do not necessarily represent those of the 
company.

--
Unsubscribe mailto:[EMAIL PROTECTED]
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

Reply via email to