Groups
Groups
Sign in
Groups
Groups
comp.sys.raspberry-pi
Conversations
About
Send feedback
Help
Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss
Learn more
GPIO status Via SNMP
265 views
Skip to first unread message
Tom Osier
unread,
Mar 6, 2018, 12:07:19 PM
3/6/18
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi All,
Am trying to monitor GPIO using SNMP but get zero values for snmp queries.
I think its got something to do with the user access rights.
I have created an "snmp" user and given him sudo rights but still get a zero on the snmp query. I also added user snmp to gpio group.
The bash code is as below (GetStatus01):
Code: Select all
#!/bin/bash
if [ "$1" = "-g" ]
then
echo .1.3.6.1.2.1.25.1.9.0
echo gauge
sudo python3 /home/pi/myFlask/GetStatus01.py
fi
exit 0
The output of bash script is ok as below:
Code: Select all
pi@raspberrypi:~ $ /home/pi/myFlask/GetStatus_01 -g
.1.3.6.1.2.1.25.1.9.0
gauge
1
"GetStatus01.py" prints a "0" or "1" based on the gpio pin status
The file snmpd.conf has been modified as below:
Code: Select all
pass .1.3.6.1.2.1.25.1.8.0 /bin/sh /home/pi/snmp-temp -g
pass .1.3.6.1.2.1.25.1.9.0 /bin/sh /home/pi/myFlask/GetStatus_01 -g
The "snmp-temp -g" points to the pi temp code above and this works ok when snmp data is requested by an external program
But "GetStatus_01 -g" always presents a zero result.
Am I missing something?
Tom
David Taylor
unread,
Mar 6, 2018, 2:50:14 PM
3/6/18
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I had a similar issue, which required making the users pi and snmp a
member of the group: i2c. Perhaps you need something similar.
See:
http://www.satsignal.eu/raspberry-pi/monitoring.html
in the paragraph starting: A problem ...
That was from help here on this group!
--
Cheers,
David
Web:
http://www.satsignal.eu
Andrew Gabriel
unread,
Mar 7, 2018, 4:05:39 AM
3/7/18
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
In article <
0a8a059d-48e3-4335...@googlegroups.com
>,
What happens if you run the script as whatever user snmpd runs as?
How does GetStatus01.py access the gpio pins? There is more than one way.
--
Andrew Gabriel
[email address is not usable -- followup in the newsgroup]
0 new messages