Hi Fredrik,

I'm no big fan of OPC either! The choice of protocols is more or less limited 
to what the SCADA system itself will support. Perhaps if I ask them nicely they 
will create an SNMP module for me so that SCADA will support it directly!

My problem is that my programming skills are limited to control programs for 
PLC's and the like so I'm not geared up for writing windows apps. If I was, I'm 
sure it would be easy to whip up my own custom written command line program to 
do exactly what I need. :o\

The SNMP device I am querying is a data radio and I am getting the Received 
Signal Strength Indication (RSSI) out if it. The response I get is in the 
format:

"SNMPv2-SMI::enterprises.14817.3.3.2.20.1.5.2 = INTEGER: -979"

I then use some scripting in the SCADA system to read the text file and extract 
the value at the end (-979, which represents -97.9 dBm), this is the easy bit. 
I then log that to the standard SCADA database for trending its behaviour over 
time. I'm sure there are many other applications on the market I could use to 
extract and trend this information, but I want it in the SCADA system database 
so I can use all the other trending, alarm and reporting tools I have at my 
disposal.

I have confirmed that when SCADA calls the command it runs correctly by 
including the -Lf switch. I see it create a zero byte file as previously 
discussed, but as soon as I switch the -Lf for a > (redirect to file) then 
nothing happens; no file is created. This leads me to believe that the > file 
redirection is a function of cmd.exe itself rather than some innate thing built 
into windows. Actually now that I type that it seems kind of obvious.

I've never played with Powershell before but have now looked into it and am 
pleased to report I have now created a pesky script that seems to be working 
for me quite well.

Thanks for all your help!

Daniel Wilkes

-----Original Message-----
From: Fredrik Björk [mailto:f...@skulle.se]
Sent: Friday, 4 April 2014 7:10 p.m.
To: net-snmp-users@lists.sourceforge.net
Subject: Re: SNMPGet and Log to file

Hi!

OPC is no favorite of mine, so don't go there unless you really feel the urge 
of committing you to a Windows-only protocol (all others on this list probably 
shiver at those words...). You should be able to have SCADA call the command, 
redirecting to a file and then read the contects, even without opening a 
command window. What do you need to do with the text file in SCADA efter it has 
been created?

Perhaps Cygwin ("Linux on Windows") running expect could do the trick in one go 
for you without the need for intermediate log file. I'm sure some pesky 
"PowerShell" function could do this as well.

/Fredrik

Daniel Wilkes skrev 2014-04-03 22:33:
> Hi Fredrik,
>
> Thanks for the feedback, I must admit to getting confused about the function 
> of the -L switch. (Command-Line help doesn't really make it clear that it's 
> just for error messages, I don't think).
>
> I've been using the '>' redirector in the mean-time but because the SCADA 
> system doesn't open a visible command window when it executes the command 
> there is nothing that gets redirected. I've had to resort to the rather ugly 
> solution of writing a batch file and having windows scheduler run it every 15 
> minutes to actually get a file that I can parse into the SCADA system.
>
> I've been trying to avoid the OPC route as the OPC client driver for the 
> SCADA system is an optional extra that I will have to pay for an additional 
> licence for. Since I am just experimenting at this stage I can't really 
> justify that!
>
> Thanks Again
>
> Daniel.
>
> -----Original Message-----
> From: Fredrik Björk [mailto:f...@skulle.se]
> Sent: Friday, 4 April 2014 8:57 a.m.
> To: net-snmp-users@lists.sourceforge.net
> Subject: Re: SNMPGet and Log to file
>
> Hi!
>
> The obvious solution would be to stop using Windows and start using a real 
> OS, but I guess that's not the subject of the day... SCADA systems I've 
> bumped into have been using OPC for communications. Several vendors have SNMP 
> to OPC converters (Matrikon OPC SNMP server for instance) that may be one way 
> to go for you. A warning for the Matrikon product though.
> Email me if you want to know the issues I've encountered with their product.
>
> I think the -Lf does exactly what it's supposed to do:
>
> "LOGGING OPTIONS
>          The mechanism and destination to use for logging of warning and 
> error messages can be  controlled  by  passing  various
>          parameters to the -L flag.
>
>          -Le    Log messages to the standard error stream.
>
>          -Lf FILE
>                 Log messages to the specified file."
>
> You have no errors, and hence, no lines in the log file!
>
> Try this:
>
> snmpget -v 2c  -c <community name withheld > <IP address withheld> 
> 1.3.6.1.4.1.14817.3.3.2.20.1.5.2 >> "c:\Net SNMP\Output.txt"
>
>
> http://technet.microsoft.com/en-us/library/bb490982.aspx
>
>
> /Fredrik
>
> Daniel Wilkes skrev 2014-04-03 21:31:
>> Hi Again,
>>
>> Just re-posting as I still haven't come up with a resolution to this yet and 
>> hope someone can help.
>>
>> Thanks Heaps!
>>
>> Daniel
>>
>> -----Original Message-----
>> From: Daniel Wilkes [mailto:daniel.wil...@wmk.govt.nz]
>> Sent: Thursday, 20 March 2014 12:06 p.m.
>> To: net-snmp-users@lists.sourceforge.net
>> Subject: SNMPGet and Log to file
>>
>> Hi All,
>>
>> I'm new to the world of SNMP and am trying to get snmpget to log the result 
>> to a file so I can then parse the result into our SCADA system.
>>
>> The command I am using is:
>>
>> snmpget -v 2c -Lf "c:\Net SNMP\Output.txt" -c <community name
>> withheld
>>> <IP address withheld> 1.3.6.1.4.1.14817.3.3.2.20.1.5.2
>> And the result is:
>>
>> SNMPv2-SMI::enterprises.14817.3.3.2.20.1.5.2 = INTEGER: -1029
>>
>> The "c:\Net SNMP\Output.txt" gets created but it is a zero byte file that 
>> has nothing in it, when I expect it to contain the same result text as is 
>> displayed on the screen. What am I doing wrong?
>>
>> Thanks
>>
>> Daniel.
>>
>> ________________________________
>> The information contained in this email message is CONFIDENTIAL INFORMATION 
>> and may also be LEGALLY PRIVILEGED. It is intended only for the individual 
>> or entity named above. If you are not the intended recipient, you are hereby 
>> notified that any use, review, dissemination, distribution or copying of 
>> this document is strictly prohibited. If you received this document in 
>> error, please immediately notify us by telephone (+64-3-3118900) and destroy 
>> the original message.
>>
>> _____________________________________________________________________
>> _
>> ________
>>
>> This email has been scrubbed for your protection by SMX.
>> For more information visit http://smxemail.com
>> _____________________________________________________________________
>> _
>> ________
>>
>>
>> ---------------------------------------------------------------------
>> -
>> -------- _______________________________________________
>> Net-snmp-users mailing list
>> Net-snmp-users@lists.sourceforge.net
>> Please see the following page to unsubscribe or change other options:
>> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>>
>
> ----------------------------------------------------------------------
> -------- _______________________________________________
> Net-snmp-users mailing list
> Net-snmp-users@lists.sourceforge.net
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>
> ________________________________
> The information contained in this email message is CONFIDENTIAL INFORMATION 
> and may also be LEGALLY PRIVILEGED. It is intended only for the individual or 
> entity named above. If you are not the intended recipient, you are hereby 
> notified that any use, review, dissemination, distribution or copying of this 
> document is strictly prohibited. If you received this document in error, 
> please immediately notify us by telephone (+64-3-3118900) and destroy the 
> original message.
>
> ______________________________________________________________________
> ________
>
> This email has been scrubbed for your protection by SMX.
> For more information visit http://smxemail.com
> ______________________________________________________________________
> ________
>
>
> ----------------------------------------------------------------------
> -------- _______________________________________________
> Net-snmp-users mailing list
> Net-snmp-users@lists.sourceforge.net
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
>


------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

________________________________
The information contained in this email message is CONFIDENTIAL INFORMATION and 
may also be LEGALLY PRIVILEGED. It is intended only for the individual or 
entity named above. If you are not the intended recipient, you are hereby 
notified that any use, review, dissemination, distribution or copying of this 
document is strictly prohibited. If you received this document in error, please 
immediately notify us by telephone (+64-3-3118900) and destroy the original 
message.

______________________________________________________________________________

This email has been scrubbed for your protection by SMX.
For more information visit http://smxemail.com
______________________________________________________________________________


------------------------------------------------------------------------------
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to