Cisco CUCM RIS Library. Simple to use.
Project description
ciscoris
Uses Realtime Information Service (RIS) to capture registration status of Cisco IP Phones on CUCM https://developer.cisco.com/docs/sxml/#risport70-api-reference
Install with pip or clone repo
pip install ciscoris
import ris, logcollection or other classes
from ciscoris import ris
specify your CUCM details
cucm = os.getenv('cucm', '10.10.10.10')
version = os.getenv('version', '11.5')
risuser = os.getenv('risuser', 'risadmin')
rispass = os.getenv('rispass', 'p@ssw0rd')
instanciate your RIS object
ris = ris(username=risuser,password=rispass,cucm=cucm,cucm_version=version)
input an array of phones
phones = ['SEPF8A5C59E0F1C', 'SEP1CDEA78380DE', 'SEP01CD4EF58980']
input an array of "process nodes" or nodes which run Callmanager service
subs = ['sub1', 'sub2', 'sub3']
you can use the related ciscoaxl
library grab process nodes via API.
def getSubs():
nodes = axl.listProcessNodes()
if nodes['success']:
return nodes['response']
subs = getSubs()
group phones into 1000 and check registrations per group
limit = lambda phones, n=1000: [phones[i:i+n] for i in range(0, len(phones), n)]
groups = limit(phones)
for group in groups:
registered = ris.checkRegistration(group, subs)
user = registered['LoginUserId']
regtime = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(registered['TimeStamp']))
for item in registered['IPAddress']:
ip = item[1][0]['IP']
for item in registered['LinesStatus']:
primeline = item[1][0]['DirectoryNumber']
name = registered['Name']
print('name: '+name)
print('user: '+user)
print('primary dn: '+primeline)
print('ip address: '+ip)
print('registration time: '+regtime)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ciscoris-0.0.5.tar.gz
(3.6 kB
view details)
Built Distribution
File details
Details for the file ciscoris-0.0.5.tar.gz
.
File metadata
- Download URL: ciscoris-0.0.5.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 027590bca0fcf1dbdc82d879009eae480c91109b7f543b59b6a27ccdc9059271 |
|
MD5 | 954d297b9f289f2033a3f98cee3cc7ff |
|
BLAKE2b-256 | 75144c606c129788fca53dfed3da5d26b62631f0e9090def07344bf1352ad3f2 |
File details
Details for the file ciscoris-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: ciscoris-0.0.5-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.0.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89bd48858f09476ce1eded9daee65c5992e33f4b469bcacc5c7e5df55cb1c5c1 |
|
MD5 | ec0e3384f92c010b6a58373fc91cda8c |
|
BLAKE2b-256 | 5445609eee54da8b663a3712df933c49af215398299ce61b1738edbe0327dddb |