HOME > > SENSING AND CONTROL MAIN PAGE > > CONNECTING SENSORS, ACTUATORS VIA LAN or INTERNET POSEIDON SNMP THERMOMETER

HWgroup Poseidon: Using the free SNMP tools

The Poseidon comes with three bits of good freeware...or you can fetch them from the net, if you aren't a Poseidon owner. They are SNMPView, SNMPTrap and Getif... which is badly named, I think, as, I think it lets you Get AND CHANGE information within SNMP clients.

I am very new to SNMP. If things are wrong in this, don't hesitate to tell me! (If you're as new as me: SNMP stands for Simple (ha!) Network Management Protocol. The protocol may be simple, but what it can do is far from that!) If you're also new, you might want to read CramSession's articles. (Change the number at the end of the URL to 16 for the next, and then 17)

You can skip down the page to the stuff on Getif if you wish.
You can skip down the page to the stuff on SNMPTrap if you wish.

SNMPView

To use SNMPView, just copy the folder (below D:\Poseidon\SNMP utils) from your HWgroup supplied CD to a convenient place on your hard drive, and run SNMPView.exe.

(Make you laugh? As I wrote the above, I had to go to the CD to get the path, and there I discovered D:\Poseidon\SNMP utils\SNMP_Trap_Watcher which is probably what I needed for what I was trying to do for HOURS yesterday. By bad luck, I'd started with SNMPViewer and Getif.... both good programs... for what they do.... but it took me a while to figure that out! Saving you those hours is the subject of this page. I will try to explore and write up the trap watcher another day.)

Back to SNMPview. I'm delighted to tell you that, as far as I noticed, it doesn't "do things" to your system, apart from writing to ini and log files within it's own directory (by default), or where you'd like them, if you configure accordingly. The exe just gets on with the job SNMPViewer does... it does not "install" the program.

Before it will work, you will need to make one change (at least)....

In the file devices.txt, change the IP address to the IP address you use to access your Poseidon via the web browser. You could also change "TempSens" to "TtureSens"... I always eschew using "Temp" for temperature because it can understood to imply "temporary".

Remember to save the file, once you have edited it. In all your SNMPViwer work, each time you change a file, you will need to stop and re-start SNMPViewer to see if the change did what was needed. This is true even if you opened the file from the SNMPViewer menu item.

This is a good time to connect up the Poseidon, make sure it is working via the browser. I think the browser i/f AND SNMPViewer AND Getif can all run at the same time, but until you can walk, don't try to run! Once you're happy that the Poseidon is up and running, shut the web browser. You may want to connect a momentary ("door bell" like) switch between the two terminals (in the group of four) which are farthest from the DIP switch. (The DIPs should all be "off", by the way.) That momentary switch will allow you to change the state of "input 1".

Try running SNMPViewer. It will create a table on your secrren with one line for each of the "devices" in your devices.txt file. (You only need one line, if you are only connecting one Poseidon.) The columns in the table are determined by the contents of the file called snmpviewer.cfg.

What SNMPViewer does is to send messages across the LAN to the Poseidon, asking the Poseidon to report back with some information. Assuming you have set up one temperature sensor, you would set SNMPViewer up to ask "What is the state of input 1?", "What is the state of input 2?", "What is the state of input 3?", and "What is the temperature?" (More on setting up temperature senors another time. You do that outside of SNMPViewer, but you then have to edit snmpviewer.cfg to make the Viewer "look" at the changed sensor array.)

My description sounds quite ponderous. The viewer issues the different questions one after the other, fetches the answers, posts them in the table. It repeats the process on a cycle which you can set up to suit your needs.

My snmpview.cfg, for 2 1-Wire temperature sensors, is at the bottom of this.


More on SNMPView another time... I'm running out of time, and want to touch on Getif....


Getif

Before you'll understand Getif, you need to understand a little about SNMP.

There are two parts to SNMP (Simple Network Management Protocol). SNMP-friendly devices have "inside" them something a bit like the Windows registry. It is a tree with information. It is called the MIB. While the device, e.g. a Poseidon, is operating, some of the information in that tree is updated. For instance, there's a leaf on the tree which is 1 or 2 depending on whether the "input 1" switch is closed. (Yes... 1 or 2, not 0 or 1)

So much for what's inside the devices meant to be managed.

Once you have some SNMP devices on your LAN, you can fire up software on other machines on the LAN to look at, and in some cases change, the information in the MIBs of the attached SNMP friendly devices, such as Poseidons.

Getif is one such piece of software.

I'm afraid it DOES have to be set up on your machine, but it comes with a satisfactory installer ("setup.exe", sensibly enough!), and it didn't seem to do too much to my macine.

Once you've set it up, run it from the item which will have been added to your programs menu.

On the first page, fill in the ip address you use to access your Poseidon when you access it via browser. Go to the "reachablilty" page, tick ping, click start (bottom right) and WAIT. When "Start" turns back to "Start", untick ping. If you haven't been seeing successful pings, you have things to fix.

Once you can reach the Poseidon, go to the MBrowser tab. Click Start. The memo should fill with STUFF. This is the contents of the Poseidon's MIB.

...... I'm out of time!!! If you want to know how to tell Getif to plot graphs of whatever Poseidon monitored paramters you need, logging to a file, if you wish, with whatever frequency of polling you need, etc, etc, email me!

You can have SNMPViewer and Getif running at the same time... but don't do it until you have each working on their own!

Good luck! The Poseidon is a great product... well worth a little struggle to master. And we haven't started on the SNMP traps or serial port yet!!!


SNMPTrap

SNMPTrap is well described and explained on the author's site. Click in the SNMPTrap menu item to see the relevant page.

Using SNMPTrap is sort of the opposite of using the other two programs. Whereas they send out a demand to SNMP devices for information, SNMPView listens passively, displaying things sent by the SNMP devices as a result of how they were set up. They can be set, for instance, to send a message ("SNMP trap") if the temperature falls below a certain level. I haven't yet played with what the Poseidon can do as a sender of SNMP traps, but I imagine you can tell it to re-send the message every (you choose) minute(s) if the temperature is still low.

SNMPTrap, like SNMPView, is supplied in a ready to run form, you just run the .exe, and a window appears on your screen, in which trap messages will be displayed. SNMPTrap does not use any configuration files, or write any log files.

Of course, it will only display "traps" (messages sent over the LAN by the Poseidon) if the Poseidon is sending them! Not all of what I'm about to mention may be relevant... but after I'd set up the following, when I changed the state of the input to the Poseidon's "input 1", I was rewarded with two new lines in SNMPTrap. One said "Binary 1"; the other said "Trap contains no readable strings".

You may find that you need to change very few settings.... but I found it hard to be sure what I was changing, where, and, especially with SNMP settings, was I setting where the device should look, or where it should send things. Anyway, after hours and hours, I got it working. Remember: I'm new to SNMP. The "hours and hours" are not (probably) the fault of the equipment.

My settings....

Set with Hercules setup:

IP Address 192.168.0.26; Port 80; Module IP Mask: 255.255.0.0

Gateway 0.0.0.0 Acceptable... 0.0.0.0 Acceptable Mask: 0.0.0.0

NVT box: Unticked. (I don't think you can get it to stay ticked for the Poseidon, or use the Poseidon's 9 way sub-d plug to connect via NVT. See my notes on the HWgroup I/O Controller to learn all about NVTs. (Network Virtual Terminals.)

Set with Getif:

Params tab: IP Address (upper left): 192.168.0.26

SNMP Port 161

When I'd entered those values, I pressed the "Start" button at the bottom of the page, and waited... about 10 seconds?... until at the lower right I saw "No SNMP Response". That sisn't seem to matter.

Set by putting 192.168.0.26 into my browser, and then clicking through to Flash Setup page, and selecting "General Setup" tab:



LEFT SIDE OF PANEL:
SNMP Traps: "public", 192.168.0.150 (IP address of PC browser was in), 162., "enabled" ticked.

SNMP Access: First line: "public" (community), 192.168.0.150.
SNMP Access: Second line: "private", 0.0.0.0.
For both lines, I ticked all three permissions boxes (read, write, enable)... probably like running with no firewall. You can turn some off, probably... but for now: These settings work!!

RIGHT SIDE OF PANEL:
Network: IP Addr: 198.168.0.26, Submask 255.255.0.0
Gateway: 0.0.0.0, SNMP port 161 <--- N.B. 161 here, 162 in a different place.
HTTP Port 80. Allowed 0.0.0.0 HTTP 0.0.0.0




My snmpviewer.cfg was    > > > > > >



[Misc]
# Anzahl der Spalten
# Number of Columns to display; if you add more entries below, increment this number also!
Columns=8

# SNMP-Port, optional, default 161
SNMPMsgPort=161

# Verzögerung zwischen 2 Abfragen in Millisekunden
# This is the delay between querying successive managed nodes in milliseconds
Delay=200

# Delay before timeout of a node query in milliseconds
# If queries do not return data on slow links, try increasing this value
# Zeit bis Timeout in Millisekunden
Timeout=1000

# Zeit zwischen zwei Durchläufen in Millisekunden
# time between two complete poll sequences for the device list in milliseconds
Pause=10000

# Logfile schreiben an oder aus
# set write to logfile on (1) or off (0)
Logging=1

# Name und Pfad für Logfile
# this is the name and complete path for the logfile
Logfile=snmpview.log



#This is the file with monitored addresses; optional, default is .\devices.txt
#Datei  mit Liste der abzufragenden Adressen, optional, default .\devices.txt
devices=.\devices.txt


#This is the file with monitored extreme values; optional, default is .\extremes.txt
#Datei mit den abgespeicherten Extremwerten, optional, default .\extremes.txt
extremes=.\extremes.txt

#  Beschriftung der Spaltenköpfe Syntax: Index=Überschrift
#  trägt eine Spalte den Namen 'uptime', werden die über die SNMP-OID ermittelten
#  Timeticks in die Anzeige days, hours, minutes, seconds umgewandelt.
#  These are the column headers
#  have one column the header 'uptime', the software translate timeticks to a human
#  readable form like days, hours, minutes, seconds
#  ---------------
#
Start=1
Eventlog=0
Eventlogfile=events.log
Beep=0
[Header]
0=Device
1=SensorType
2=StateX
3=TTureX
4=StateY
5=TTureY
6=in1
7=in2
8=in3

# This are the SNMP OID's, which polled frequently
# please use without 1.3.6.1, don't forgot a zero or the number of the instance at the end
# Einträge ohne führende 1.3.6.1. ,hinten 0 oder die Instanz nicht vergessen!!
# ------------------



#OID-Tabelle 0
[OID0]
1=4.1.21796.3.3.3.1.3.1
2=4.1.21796.3.3.3.1.4.1
3=4.1.21796.3.3.3.1.5.1
4=4.1.21796.3.3.3.1.4.2
5=4.1.21796.3.3.3.1.5.2
6=4.1.21796.3.3.1.1.2.1
7=4.1.21796.3.3.1.1.2.2
8=4.1.21796.3.3.1.1.2.3

[4.1.21796.3.3.3.1.3.1]
1=1-wire
2=RS232
3=RS485

[4.1.21796.3.3.3.1.4.1]
0=invalid
1=normal
2=alarm

[4.1.21796.3.3.3.1.4.2]
0=invalid
1=normal
2=alarm

[4.1.21796.3.3.1.1.2.1]
1=off
2=on

[4.1.21796.3.3.1.1.2.2]
1=off
2=on

[4.1.21796.3.3.1.1.2.3]
1=off
2=on


#Colors färbt Felder entsprechend dem ausgegebenen Text red, green, yellow oder blue
#colorized values with matched text red, green, yellow or blue
[Colors]
---=noanswer
off=blue
on=lime
local=blue
remote=green
alarm=red
normal=green

#you can define your own colornames
#use these syntax: mycolorname=#RRGGBB
[Colortable]
MinColor=#C0C0C0
MaxColor=#FF0000
Black=#000000
Maroon=#800000
Green=#008000
Olive=#808000
Navy=#000080
Purple=#800080
Teal=#008080
Gray=#808080
Silver=#C0C0C0
Red=#FF0000
Lime=#00FF00
Yellow=#FFFF00
Blue=#0000FF
Fuchsia=#FF00FF
Aqua=#00FFFF
LtGray=#C0C0C0
DkGray=#808080
CustColor1=#112233
CustColor2=#223344
CustColor3=#334455
CustColor4=#445566
CustColor5=#556677
CustColor6=#667788
CustColor7=#778899
CustColor8=#889900
CustColor9=#990011
CustColor10=#001122
noanswer=#808080

#do not change tis values, they are used by program itself (window position and size)
#Position nicht ändern, wird vom Programm verwendet!!
[Position]
ColWidth0=70
ColWidth1=42
ColWidth2=43
ColWidth3=54
ColWidth4=58
ColWidth5=51
ColWidth6=45
ColWidth7=34
Width=497
Height=105
Left=5
Top=8
ColWidth8=64
ColWidth9=64
ColWidth10=64
ColWidth11=64
ColWidth12=64
[SysLog]
Server=192.168.0.99
Server2=
Syslog=0
Facility=local.0
Severity=Info
[Mail]
Mail=0
to=
cc=
from=
SMTPhost=
Subject=Message from SNMPView



   Search this site or the web        powered by FreeFind
 
  Site search Web search
Site Map    What's New    Search The search engine merely looks for the words you type, so....
*    Spell them properly.
*    Don't bother with "How do I get rich?" That will merely return pages with "how", "do", "I"....

Please also note that I have two other sites, and that this search will not include them. They have their own search buttons.
My site at Arunet.
My oldest site. (It's at Compuserve).
Ad from page's editor: Yes.. I do enjoy compiling these things for you... hope they are helpful. However.. this doesn't pay my bills!!! If you find this stuff useful, (and you run an MS-DOS or Windows PC) please visit my freeware and shareware page, download something, and circulate it for me? At least (please) send an 'I liked the parallel port use page, and I'm from (country/ state)' email? (No... I don't do spam) Links on your page to this page would also be appreciated!
Click here to visit editor's freeware, shareware page.

Other projects

This is just one of the guides I have published on the net. Please visit any of the following that relate to interests you have....

Delphi Tutorials
Pascal programming tutorials
Electronics for hobbyists and schools
Main Home Page

Here is how you can contact this page's author, Tom Boyd.

Index of sensing and control pages (From there you can also go to other help from the editor of this page.)

-- Page ends --