This is how I managed to graph environmental data from Avocent EVR1500 units.
Background
I have had some experience with Cacti before, primarily using SNMP to get the information I needed. I was intending to do the same with the EVR's however soon discovered that whilst they could send SNMP traps, you couldn't do a snmpwalk on the device to get the information. As the EVRs are Linux based devices, I toyed with the idea of putting a proper implementation of snmp on the devices however due to warranty issues and firmware upgrades I was unable to.
What I needed to do to get the data into Cacti was:
- set EVRs to send snmp traps on a schedule
- collect the traps
- parse the information into the correct format
- collect and graph with Cacti
EVR Setup
Follow the manual and setup the devices to send traps to the trap collector using timed rules. I have them sending temperature and humidity information for over 50 sensors.
Collecting Traps
To collect the traps I just set up snmptrapd on the Linux server (RHEL3) that I had Cacti installed on. Just make sure the snmptrapd puts the information into the log file in the correct format. I used the following option in /etc/init.d/snmptrapd.
OPTIONS="-u /var/run/snmptrapd.pid -Oq -o /www/htdocs/cacti/log/trap.log"
Parse information
To pull out the information required from the trap.log for Cacti to use I had to write a small script. I'm no programmer and it is messy and could no doubt be improved on, but it works.
The script does the following:
1. Clean up trap.log to only contain valid snmp data and place in temp file.
2. Takes a single argument passed from Cacti and finds corresponding value in the temp file.
3. Cleans out the orginal trap.log.
4. Deletes the argument and value just retrieved and repopulates trap.log ready for next iteration.
5. Cleans out the temp file.
The script is attached and if anyone can improve on this, please do.
Cacti Setup
Now I just needed to create a data input method to use the script with a single input (the argument passed to the script). From there I created a data template and used this to create data sources for each humidity and temperature sensor.
It is a bit messy but it works. Hopefully Avocent will upgrade the EVRs so that we can just "walk" the device rather than collecting and manipulating snmptrap data.
How to for Avocent Environmental Monitoring Units (EVR1500)
Moderators: Developers, Moderators
How to for Avocent Environmental Monitoring Units (EVR1500)
- Attachments
-
- avocentcactiscript.txt
- Bash script used to parse snmptrap log.
- (575 Bytes) Downloaded 263 times
Who is online
Users browsing this forum: No registered users and 0 guests