Пример #1
0
 def do_secadm(self, variable1):
     "ENM CLI secadm parancs te feregnovendek, Te sivatagi hollokutya teee"
     if variable1 and variable1 in self.cmedit_opt:
         command = 'secadm %s!' % variable1
     elif variable1:
         command = "secadm " + variable1
     else:
         command = 'hello baby'
     print(command)
     session = enmscripting.open('<ENM Launcher URL>').with_credentials(
         enmscripting.UsernameAndPassword('<user name>', '<password>'))
     terminal = session.terminal()
     response = terminal.execute(command)
     for line in response.get_output():
         print(line)
     enmscripting.close(session)
Пример #2
0
 def do_cmedit(self, variable1):
     "ENM CLI cmedit parancs te pondro, ha ennyit se tudsz szopjal falovat"
     if variable1 and variable1 in self.cmedit_opt:
         command = 'cmedit %s!' % variable1
     elif variable1:
         command = "cmedit " + variable1
     else:
         command = 'hello baby'
     print(command)
     session = enmscripting.open('<ENM Launcher URL>').with_credentials(
         enmscripting.UsernameAndPassword('<user name>', '<password>'))
     terminal = session.terminal()
     response = terminal.execute(command)
     for line in response.get_output():
         print(line)
     enmscripting.close(session)
Пример #3
0
 def do_MozoKedvence(self, variable1):
     "Elore definialt ENM CLI parancsok a'la cmedit"
     if variable1 and variable1 in self.cmedit_collection:
         command = '%s' % variable1
     elif variable1:
         command = variable1
     else:
         command = 'hello baby'
     print(command)
     command = command[0:0:] + command[3::]
     print(command)
     session = enmscripting.open('<ENM Launcher URL>').with_credentials(
         enmscripting.UsernameAndPassword('<user name>', '<password>'))
     terminal = session.terminal()
     response = terminal.execute(command)
     for line in response.get_output():
         print(line)
     enmscripting.close(session)
#Author - Sumanth Govind ([email protected])
#DO NOT EDIT THIS FILE

import enmscripting
from getpass import getpass
import sys

user_name = input('ENM User Name: ')
user_password = getpass('ENM User Password: '******'https://syl9launcher.syl9enm1.mgmt/').with_credentials(enmscripting.UsernameAndPassword(str(user_name),str(user_password)))
except (NameError,ValueError):
    sys.exit("Invalid Login/Connectivity to ENM failed")
channel = input("Enter Frequency to be deleted: ")
#channel_type = input("Is the above channel FDD or TDD: ").upper()
if int(channel)<10000:
    channel_type ='FDD'
else:
    channel_type='TDD'

coll_or_node = input("Enter Collection name or Node name: ")

#coll_or_node='TPA'

def freq_del(inputt):
    response = session.terminal().execute(inputt)
    for line in response.get_output():
        if "FDN" in line:
            inputt='cmedit delete ' +line.replace("FDN : ","")+ ' -ALL'
            #print(inputt)
Пример #5
0
#Simple python script to execute ENM CLI commands in script server by toja
#This script uses the ENM CLI api: enmscriptiong

import enmscripting
import sys

session = enmscripting.open('<ENM Launcher URL>').with_credentials(
    enmscripting.UsernameAndPassword('<user name>', '<password>'))
print '*********** Delete ENM Radionode by TOJA **************'

command = 'cmedit set NetworkElement=%s,PmFunction=1 pmEnabled=false' % (
    sys.argv[1])
terminal = session.terminal()
response = terminal.execute(command)
for line in response.get_output():
    print(line)

command = 'cmedit set NetworkElement=%s,InventorySupervision=1 active=false' % (
    sys.argv[1])
response = terminal.execute(command)
for line in response.get_output():
    print(line)

command = 'cmedit set NetworkElement=%s,CmNodeHeartbeatSupervision=1 active=false' % (
    sys.argv[1])
response = terminal.execute(command)
for line in response.get_output():
    print(line)

command = 'alarm disable %s' % (sys.argv[1])
response = terminal.execute(command)
Пример #6
0
#Simple python script to execute ENM CLI commands in script server by toja
#This script uses the ENM CLI api: enmscriptiong
#Usage python enable_NE.py <NE_NAME>

import enmscripting
import sys

session = enmscripting.open('<ENM Launcher URL>').with_credentials(enmscripting.UsernameAndPassword('<user name>','<password>'))
print '*********** Enable ENM Radionode by TOJA **************'

command = 'cmedit set NetworkElement=%s,PmFunction=1 pmEnabled=true'%(sys.argv[1])
terminal = session.terminal()
response = terminal.execute(command)
for line in response.get_output():
    print(line)

command = 'cmedit set NetworkElement=%s,InventorySupervision=1 active=true'%(sys.argv[1])
response = terminal.execute(command)
for line in response.get_output():
    print(line)

command = 'cmedit set NetworkElement=%s,CmNodeHeartbeatSupervision=1 active=true'%(sys.argv[1])
response = terminal.execute(command)
for line in response.get_output():
    print(line)


command = 'alarm enable %s'%(sys.argv[1])
response = terminal.execute(command)
for line in response.get_output():
    print(line)