1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 <2024> 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re:Re: epics snmp |
From: | White via Tech-talk <tech-talk at aps.anl.gov> |
To: | "Priller, John" <priller at frib.msu.edu> |
Cc: | Jörn Dreyer <j.dreyer at hzdr.de>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Tue, 19 Mar 2024 14:13:50 +0800 (CST) |
The db file is as follows:
record(ao,"$(DEV):Switch1")
{
field(DESC,"SNMP channel")
field(DTYP,"Snmp")
field(SCAN,"Passive")
field(PREC,"3")
field(OUT,"@$(HOST) guru $(MIB)::pduOutletSwitchedControlCommand.1.2 INTEGER: 100")
}
The mib file is as follows:
pduOutletSwitchedControlCommand OBJECT-TYPE
-- FROM ENLOGIC-PDU-MIB
SYNTAX INTEGER {immediateOff(1), immediateOn(2), delayedOff(3), delayedOn(4), immediateReboot(5), delayedReboot(6), outletUnknown(7)}
MAX-ACCESS read-write
STATUS current
DESCRIPTION "Getting this variable will return the outlet state.
If the outlet is on, the immediateOn (2)
value will be returned. If the outlet is off,
the immediateOff (1) value will be returned.
If the state of the outlet cannot be determined, the
outletUnknown (7) value will be returned. If the
outletUnknown condition should occur, all devices
powered by the PDU should be shut down. The PDU's
power should then be cycled to clear this condition.
Setting this variable to immediateOn (2) will immediately
turn the outlet on. Setting this variable to
immediateOff (1) will immediately turn the outlet off.
Setting this variable to immediateReboot (5)
will cause the Switched PDU to perform an immediateOff
command, wait the pduOutletSwitchedConfigRebootDuration
OID time, and then perform an immediateOn command.
Setting this variable to delayedOn (4) will turn the
outlet on after the pduOutletSwitchedConfigPowerOnTime
OID time has elapsed. Setting this variable to
delayedOff (3) will turn the outlet off after the
pduOutletSwitchedConfigPowerOffTime OID time has elapsed.
Setting this variable to delayedReboot (6) will cause
the Switched PDU to perform a delayedOff command, wait
the pduOutletSwitchedConfigRebootDuration OID time, and
then perform a delayedOn command."
::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) enlogic(38446) pdu(1) pduOutlet(5) pduOutletSwitchedControlTable(5) pduOutletSwitchedControlEntry(1) pduOutletSwitchedControlCommand(4) 1 2 }
The value obtained with caget is 0, which does not match the
actual value:
caget TEST:Switch1
TEST:Switch1 0
Is there an error somewhere in
the db file?
Is there any detailed documentation of the db file for SNMP connections?
Thanks,
White
At 2024-03-14 18:30:42, "Priller, John via Tech-talk" <tech-talk at aps.anl.gov> wrote:
(I missed the tech-talk post Jörn replied to, weird...)
I think the issue is that your INP field isn't right.
field(INP,"@$(HOST) public $(MIB)::pduInputPhaseSTATUSVoltage.1.1 Float 100")
The text field after the OID (here, that's $(MIB)::pduInputPhaseSTATUSVoltage.1.1) is a string the driver should look for in the device's reply string, to help locate where the value text is. You're using "Float" for this, when your device appears to be returning "INTEGER:". Try this:
Or, you could instruct the driver to use native data types instead of strings, using the 'n' flag. For example:field(INP,"@$(HOST) public $(MIB)::pduInputPhaseSTATUSVoltage.1.1 INTEGER: 100")
field(INP,"@$(HOST) public $(MIB)::pduInputPhaseSTATUSVoltage.1.1 INTEGER: 100 in")
Where the "in" flags field has an "i" for integer format and a "n" to specify native format. In this case the driver ignores the "INTEGER:" text locator field (but you still have to specify something there).
- JP
From: Jörn Dreyer <j.dreyer at hzdr.de>
Sent: Thursday, March 14, 2024 5:28 AM
To: Priller, John; tech-talk at aps.anl.gov
Cc: tech-talk at aps.anl.gov; White
Subject: Re: epics snmp[EXTERNAL] This email originated from outside of FRIB
Hi White,
do you have access to the IOC shell?
If so, try the following:
dbpr TEST:Voltage
(This will print out the actual value (VAL field) as stored in the IOC database. Should be 0 as in the caget command)
dbtr TEST:Voltage
(This will trigger the processing of the record and print the result (VAL field))
Check the STAT field of both outputs. This will tell you if an error occurred during processing of the record.
Regards
Jörn
Am Donnerstag, 14. März 2024, 09:48:06 CET schrieb White via Tech-talk:
> Thank you for your help,I changed the port to 5064. Now I have a new problem.
> The value I get with the snmpget command is 219:
>
>
> snmpget -v1 -c public 192.168.0.1 ENLOGIC-PDU-MIB::pduInputPhaseSTATUSEntry.6.1.1
>
> ENLOGIC-PDU-MIB::pduInputPhaseSTATUSVoltage.1.1 = INTEGER: 219
>
>
>
> The value obtained with caget is 0, which does not match the actual value:
>
> caget TEST:Voltage
>
> TEST:Voltage 0
>
>
>
> The db file is as follows:
>
>
>
> record(ai,"$(DEV):Voltage")
>
> {
>
> field(DESC,"SNMP channel")
>
> field(DTYP,"Snmp")
>
> field(SCAN,".2 second")
>
> field(PREC,"3")
>
> field(INP,"@$(HOST) public $(MIB)::pduInputPhaseSTATUSVoltage.1.1 Float 100")
>
> }
>
>
>
> The mib file is as follows:
>
> pduInputPhaseSTATUSVoltage OBJECT-TYPE
>
> -- FROM ENLOGIC-PDU-MIB
>
> SYNTAX Integer32
>
> MAX-ACCESS read-only
>
> STATUS current
>
> DESCRIPTION "Returns the voltage, in Volts(V)"
>
> ::= { pduInputPhaseSTATUSEntry 6 }
>
>
>
> Is there an error somewhere in the db file?
>
>
> Thanks,
> White
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> At 2024-03-13 18:30:54, "Priller, John via Tech-talk" <tech-talk at aps.anl.gov> wrote:
>
>
>
>
> It doesn't appear to be related to SNMP (that's my driver, if you need help with it), it looks like the issue is you're changing the EPICS_CA_SERVER_PORT in your st.cmd.
>
>
>
>
> By default, caget is going to use port 5064. Do you also set an environment variable for this in the console you're running caget in?
>
>
>
> To make doubly sure that your IOC does in fact have a TEST:Current record, what are the results of a "dbl" command in your IOC's shell? You can add the dbl command to the end of your st.cmd to check the output from that, if you're not running the IOC with an active shell under procServ or similar.
>
>
> From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of White via Tech-talk <tech-talk at aps.anl.gov>
> Sent: Wednesday, March 13, 2024 4:44 AM
> To: tech-talk at aps.anl.gov
> Subject: epics snmp
>
> [EXTERNAL] This email originated from outside of FRIB
>
>
> Hi,
> I'm trying to control the device using the SNMP protocol and the db file is as follows:
>
>
>
> record(ai,"$(DEV):Current")
>
> {
>
> field(DESC,"SNMP channel")
>
> field(DTYP,"Snmp")
>
> field(SCAN,".2 second")
>
> field(PREC,"3")
>
> field(INP,"@$(HOST) public $(MIB)::pduInputPhaseSTATUSCurrent.1.1 Float 100")
>
> }
>
>
>
> The st.cmd file are as follows:
>
> < envPaths
>
>
>
> epicsEnvSet("EPICS_CA_SERVER_PORT", 6310)
>
> epicsEnvSet("EPICS_PVA_SERVER_PORT", 6710)
>
> epicsEnvSet("MIBDIRS", "+$(TOP)/mibs:/usr/local/share/snmp/mibs")
>
> epicsEnvSet("IOCNAME","npdu")
>
> cd "${TOP}"
>
> ## Register all support components
>
> dbLoadDatabase "dbd/npdu.dbd"
>
> npdu_registerRecordDeviceDriver pdbbase
>
> devSnmpSetSnmpVersion(192.168.0.1:161,SNMP_VERSION_1)
>
> devSnmpSetMaxOidsPerReq(192.168.0.1:161,50)
>
> dbLoadRecords "db/dbpdux.db", "DEV=TEST, HOST=192.168.0.1, MIB=ENLOGIC-PDU-MIB"
>
> cd "${TOP}/iocBoot/${IOC}"
>
> iocInit
>
> But there is an error:
>
> caget TEST:Current
>
> Channel connect timed out: 'TEST:Current' not found.
>
> If there is no error in the DB, the device is not connected, is there an error in the st.cmd file?
> Thanks,
> White
>