Closed sgelineau17 closed 2 years ago
It looks like it does not find libsmi development files (I suppose this should libsmi-devel
). Are they installed? rpm -qa | grep libsmi
Hello,
The package are installed.
Thanks
That's not the devel package (the one containing the headers)
Oh ok, I undestand, I don't find it when I run a "dnf search libsmi", I only have this :
Ok, I'm sorry, on AlmaLinux (not on Rocky, CentOS...) the repository "Powertools" was not enable by default, I enable it and I have installed libsmi-devel.
My other problem is when I try to start my python script, I obtained this error message :
/usr/bin/env: ‘snimpy’: No such file or directory
Do you have an idea ?
`#!/usr/bin/env snimpy
from pprint import pprint as pp
import ipaddress import pickle
ips = [ 'IP RT 1', 'IP RT 2', ]
load('IF-MIB')
status = {}
for ip in ips: ipaddress.IPv4Address(ip) #test if valid ip address pp(ip)
status[ip] = {}
with M(
host=ip,
version=2,
community='COMMUNITY',
) as m:
for id in m.ifIndex:
#pp(id)
status[ip][int(id)] = {
'admin_status': str(m.ifAdminStatus[id]),
'alias': str(m.ifAlias[id]),
'descr': str(m.ifDescr[id]),
'last_change': str(m.ifLastChange[id]),
'oper_status': str(m.ifOperStatus[id]),
'speed': str(m.ifSpeed[id]),
'type': str(m.ifType[id]),
}
with open('status_nexus.pkl', 'wb') as f: pickle.dump(status, f, pickle.HIGHEST_PROTOCOL)`
Je m'embête à te parler Anglais alors que tu es Français :)
With --user
, I suppose it gets installed in ~/.local/bin. This should be added to your path for this to work.
I just checked indeed, it seems to be present in ~/.local/bin
I have try my run my script with --user but it's not working.
Thanks for your help !
What's echo $PATH
?
Here is the answer
So, ~/.local/bin
is not in it. export PATH=$PATH:~/.local/bin
.
Thanks a lot ! subject can be closed
Hello,
I try to install snimpy on my new AlmaLinux 8.6 VM but the installation is failed.
The OS are full update, gcc are installed and all of dev librairie whose libsmi. I use python 3.6.8.
The VM have been restart but I always this error message :
Thanks a lot !