- Community Home
- >
- Networking
- >
- Switching and Routing
- >
- Web and Unmanaged
- >
- HPE OfficeConnect Switch 1820 8G J9979A : get CPU ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2018 12:42 AM
09-07-2018 12:42 AM
Hi!
I have a switch with model and version firmware: HPE OfficeConnect Switch 1820 8G J9979A, PT.02.05, Linux 3.6.5, U-Boot 2012.10-00116.
I get statistics on interfaces by snmp. How do I get the snmp load of cpu and memory usage from snmp? Via the web this information is available.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2018 04:52 AM
09-12-2018 04:52 AM
Re: HPE OfficeConnect Switch 1820 8G J9979A : get CPU and memory utilization from SNMP 1
Hi,
From the management and config guide of this switch.
Link :- http://h20564.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay/?docId=c04622710
The switch supports the following MIB only.
The switch supports the following MIBs: • BRIDGE-MIB (IEEE 802.1Q) • LLDP-MIB (IEEE 802.3AB) • EtherLike-MIB • IF-MIB • RFC1213-MIB • RMON-MIB (RMON History as in v1) • Power Ethernet MIB (RFC3621), only on switches that support PoE+. (No SNMP information is available on configured PoE schedules.)
I am an HPE employee
-------------------------------------------------------------------------
Was the post useful? Click on Kudos Thumb below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2018 08:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2019 11:34 AM
06-03-2019 11:34 AM
Re: HPE OfficeConnect Switch 1820 8G J9979A : get CPU and memory utilization from SNMP 1
I'm having the same problem with the 1920s model, how would this script get data from web console?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2019 07:01 PM - last edited on 06-03-2019 11:56 PM by Parvez_Admin
06-03-2019 07:01 PM - last edited on 06-03-2019 11:56 PM by Parvez_Admin
Re: HPE OfficeConnect Switch 1820 8G J9979A : get CPU and memory utilization from SNMP 1
This is my script to get CPU and Memory on web console. It's written by python language. So you must install it on your monitor server.
Please could you send me your email through a private message by clicking here . I will send file script to you.
Note:
My script use with 1820 model. I don't sure with 1920s, it can login web console with same url in script
Because the script use browser to get data, It's get more performance of your monitor server. If you have many switch 1920s, you will lost many RAM and CPU for it.
------------------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/env
import requests, json, sys
#import compago
#app = compago.Application()
session = requests.Session()
session.trust_env = False
url = "http://" + sys.argv[1]
urlLogin = "/htdocs/login/login.lua"
urlData = "/htdocs/pages/base/support.lsp"
urlLogout = "/htdocs/pages/main/logout.lsp"
username = sys.argv[3]
password = sys.argv[4]
#@app.command
def getCPU():
if login()==0:
print "login failed"
else:
responseData = login()
html = responseData.text
noFindCPUStr = html.find('id="cpu_util_prog_bar_val">')
noCPUStr = len('id="cpu_util_prog_bar_val">')
cpu = responseData.text[noFindCPUStr + noCPUStr:(noFindCPUStr + noCPUStr + 2)]
print cpu
logout()
#@app.command
def getMem():
if login()==0:
print "login failed"
else:
responseData = login()
html = responseData.text
noFindMEMStr = html.find('id="mem_util_prog_bar_val">')
noMEMStr = len('id="mem_util_prog_bar_val">')
memory = responseData.text[noFindMEMStr + noMEMStr:(noFindMEMStr + noMEMStr + 2)]
print memory
logout()
def login():
data = {'username':username,'password':password}
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
responseLogin = session.post(url + urlLogin, data, headers)
#print responseLogin.status_code
if responseLogin.status_code == 200:
#Logincookies = responseLogin.cookies
#responseData = session.post(url + urlData, cookies = Logincookies)
responseData = session.post(url + urlData)
#html = responseData.text
#print html
return responseData
else:
return 0
def logout():
session.post(url + urlLogout)
#print logout.status_code
session.close()
if __name__ == "__main__":
#app.run()
if sys.argv[2] == "getCPU":
getCPU()
elif sys.argv[2] == "getMem":
getMem()
else:
print "Invalid argument! (script.py ip function)"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2020 11:27 PM
07-13-2020 11:27 PM
Re: HPE OfficeConnect Switch 1820 8G J9979A : get CPU and memory utilization from SNMP 1
I have the same problem as you.
I am also using the HPE 1820-24G switch.
I found that CPU/MEMORY can't be found in MIB, so I can only collect it with your script.
Can you e-mail me your complete script?
I couldn't run the code above because I don't know python.
I want to get your .py file.
I would be very grateful if you could provide it.
Thank you.
bjkim@nalintech.co.kr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2020 12:40 AM
07-14-2020 12:40 AM
Re: HPE OfficeConnect Switch 1820 8G J9979A : get CPU and memory utilization from SNMP 1
https://mega.nz/file/qpAUhQDT#OyMMr_oqyBr19rJEiQTvpNR_5WKQv0yHin9nh6ucafk
https://mega.nz/file/zoQGTaRQ#rgG3IKexUH9dVe5YbceCh6Wq9E7-LLLH8sU_uCmiG_Y
This is my python script and bash script sample called python script. The $1 $2 $3 $4 is argument.
This is sample when you need get memory used percent:
"/usr/bin/python /usr/lib/zabbix/externalscripts/HPSwitch.py ip_switch getMem username_webconsole_Switch password_webconsole_Switch"
"/usr/bin/python /usr/lib/zabbix/externalscripts/HPSwitch.py 192.168.1.245 getMem admin 123456"
for getCPU
"/usr/bin/python /usr/lib/zabbix/externalscripts/HPSwitch.py 192.168.1.245 getCPU admin 123456"
You need to setup python on server and install "requests, json, sys" library. I writen this script long time ago. I can't remember exactly. May be the library ready existing in python when you install it.
The last, Your monitor system must be support extenal or internal script like zabbix. And you will create extenal or internal script item.
Please talk me detail your problem. I will support you. (your monitor system, url your hp switch web console)
The url web console must to same url bellow:
url = "http://" + sys.argv[1] (http://192.168.1.245)
urlLogin = "/htdocs/login/login.lua" (http://192.168.1.245/htdocs/login/login.lua - login url web console)
urlData = "/htdocs/pages/base/support.lsp" (http://192.168.1.245/htdocs/pages/base/support.lsp - have cpu and memory info in here)
urlLogout = "/htdocs/pages/main/logout.lsp" (http://192.168.1.245/htdocs/pages/main/logout.lsp - logout url web console)
Sorry for my bad English!