Comments (10)
@tdanner can you help?
from orionsdk-python.
What kind of node are you monitoring? 9 is the code for the SnmpCisco polling method. See the Hardware Health page on the Orion SDK wiki for additional details about the options.
from orionsdk-python.
Its a network device. Infact a cisco switch. I referred that page, hence used 9 in my code.
But I am not sure how to enable CPU and Mem monitoring/stats collection.
from orionsdk-python.
Hi,
unfortunately, HardwareHealth and SNMP/CPU polling are implemented in pretty different manner.
For SNMP/CPU polling, you need to add proper pollers to the Orion.Pollers entity. That could be tricky - there are many of them applicable for Cisco SNMP devices, and I can't tell which one to enable.
Orion detects them during inventory step - I'm not sure if it happens during adding node in import. You can check on your own:
SELECT PollerType, Enabled FROM Orion.Pollers WHERE PollerType LIKE 'N.CPU.SNMP.%' AND NetObjectType='N' AND NetObjectId=@your_node_id
.
This returns something like 'N.CPU.SNMP.HrProcessorLoad' (for my windows machine). If it is disabled, you can just update the entity, set Enabled to true, and you're good. Same goes for 'N.Memory.%' poller.
In the case they are not there, you need to enforce Inventory re-run.
note: these steps are undocumented, and may change or stop working any time in the future.
There is Orion.NodeSettings entity, which is - pretty much - key-value pair store for nodes.
And the magic here is to add key 'Core.NeedsInventory' with value 'Cpu:Memory'. Orion then should re-run the inventory job, populating pollers table.
from orionsdk-python.
Hey nothrow,
What exactly is this inventory job? Anyway to trigger it through code?
Regards,
Ambica
from orionsdk-python.
You can add, using create operation, key:value Core.NeedsInventory
: Cpu:Memory
, with proper NodeId, to Orion.NodeSettings
entity.
from orionsdk-python.
tried it, still does not help.
May be this is not applicable for cisco switches?
For interfaces, we can invoke DiscoverInterfacesOnNode on Orion.NPM.Interfaces entity and then we can add whatever pollers we need. But we dont have any entity related to CPU or Memory or other resources? How is the listresources.aspx working?
from orionsdk-python.
How is the listresources.aspx working?
Kind of black magic. It calls some local WebAPI endpoints, and does lot of pre/postprocessing. It is not straightforward to use, and cannot be used as public API.
But we dont have any entity related to CPU or Memory or other resources?
Not at this moment. DiscoverInterfacesOnNode
were kind of hacked in just for one specific purpose per request.
May be this is not applicable for cisco switches?
WorksForMe(tm). But it is not immediate, it takes some time.
Steps I've taken:
- I deleted all pollers from the Orion.Pollers entity for given node.
- I added proper NodeSetting value:
- Waited for few minutes (10 minutes is the background inventory checker default interval. It can be reduced from settings)
- Pollers reappear
import requests
from orionsdk import SwisClient
server = 'localhost'
username = 'admin'
password = ''
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
swis = SwisClient(server, username, password)
pollers = swis.query("SELECT PollerType, Uri FROM Orion.Pollers WHERE NetObjectID = 1003")
for row in pollers['results']:
print("Deleting poller {PollerType}".format(**row))
swis.delete(row['Uri'])
print("Adding nodesetting")
props = {
'NodeID': 1003,
'SettingName': 'Core.NeedsInventory',
'SettingValue': 'Cpu:Memory'
}
results = swis.create('Orion.NodeSettings', **props)
print("wait for 15 minutes (interval of background inventory check)")
Output:
Deleting poller N.Status.ICMP.Native
Deleting poller N.Status.SNMP.Native
Deleting poller N.ResponseTime.ICMP.Native
Deleting poller N.ResponseTime.SNMP.Native
Deleting poller N.Details.SNMP.Generic
Deleting poller N.Uptime.SNMP.Generic
Deleting poller N.Cpu.SNMP.CiscoGen3
Deleting poller N.Memory.SNMP.CiscoGen3
Deleting poller N.Routing.SNMP.Ipv4CidrRoutingTable
Deleting poller N.RoutingNeighbor.SNMP.BGP
Deleting poller N.Topology_Vlans.SNMP.VtpVlan
Deleting poller N.Topology_CDP.SNMP.cdpCacheTable
Deleting poller N.Topology_Layer3.SNMP.ipNetToMedia
Deleting poller N.Topology_Layer3_IpRouting.SNMP.rolesRouter
Deleting poller N.Topology_Layer3_IpRouting.SNMP.ipCidrRouter
Adding nodesetting
wait for 15 minutes (interval of background inventory check)
after few minutes the line from Orion.NodeSettings disappear, and pollers appear:
import requests
from orionsdk import SwisClient
server = 'localhost'
username = 'admin'
password = ''
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
swis = SwisClient(server, username, password)
pollers = swis.query("SELECT PollerType, Enabled FROM Orion.Pollers WHERE NetObjectID = 1003")
for row in pollers['results']:
print("Poller: {PollerType}:{Enabled}".format(**row))
:
Poller: N.Cpu.SNMP.CiscoGen3:True
Poller: N.Memory.SNMP.CiscoGen3:True
Note: it takes some time.
Note2: please, do not delete all pollers on production server. The code with delete was meant only as an example.
from orionsdk-python.
You can also check that everything works correctly in logs.
"c:\Users\All Users\SolarWinds\Logs\Orion\Core.BusinessLayer.log"
2019-05-16 14:03:27,769 [STP SmartThreadPool Thread #1] INFO SolarWinds.Orion.Core.BusinessLayer.BackgroundInventoryManager - (null) Starting inventorying of Node 1003, NeedsInventory = 'Cpu:Memory'
2019-05-16 14:03:28,966 [STP SmartThreadPool Thread #1] INFO SolarWinds.Orion.Core.BusinessLayer.BackgroundInventoryManager - (null) Inventorying of Node 1003 completed in 1213ms.
2019-05-16 14:03:28,966 [STP SmartThreadPool Thread #1] INFO SolarWinds.Orion.Core.BusinessLayer.BackgroundInventoryManager - (null) Background Inventorying Finished
from orionsdk-python.
This question has been answered, and there hasn't been any recent conversation on this thread, so I am closing this issue for now. Feel free to re-open the issue if additional information is needed.
from orionsdk-python.
Related Issues (20)
- Unable to get resources list of a node HOT 10
- OrionSDK not permanently setting interface status on Node HOT 1
- requests.exceptions.HTTPError: 400 Client Error: Update or insert of view or function 'dbo.NCM_Nodes' failed because it contains a derived or constant field. HOT 1
- SVI showing None for InAveragebps HOT 5
- snmp-testing HOT 5
- SNMPv3 RW Credentials
- Issue with Updating Custom Properties HOT 6
- Unable to find poller_type for creating node HOT 3
- Disabling specific sensors via python HOT 1
- SettingValue(credentialID) is not getting updated HOT 1
- How to test for SNMP credentials using Rest API HOT 2
- Use any port number if specified to initialize client
- HTTP Connection Issue: Authentication Failed
- SwisClient bulkdelete method not in PyPi HOT 1
- SolarWinds Duplicate ICMP Device Listings
- Question on Suppress Alerts
- 403 Client Error: Access to Orion.AlertSuppression.SuppressAlerts verb denied
- pip install orionsdk gets version 0.3 HOT 5
- Connection aborted.', ConnectionResetError(104, 'Connection reset by peer
- Python syntax to override port to use 17774 instead default 17778 to connect to orion ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orionsdk-python.