Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+4
Strength to Decrease Rep
-1
100% Quality Score
Upvotes Received
2
Posts with Upvotes
2
Upvoting Members
2
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
2 Commented Posts
~74.5K People Reached
Favorite Forums
Favorite Tags

55 Posted Topics

Member Avatar for novice20

[B]Hi all.. I need to do a condition check in a script. The same condition check needs to be repeated in another script. So, I am looking for a way, where i can set, say a flag in the first script ,upon meeting the condition, and be able to access …

Member Avatar for Cisco_1
0
37K
Member Avatar for novice20

hi all... how to find the localhost ip address in python [B]import socket socket.gethostbyname(socket.gethostname())[/B] gives me 127.0.0.1 instead of my ip address any help...........

Member Avatar for Suraj_2
0
927
Member Avatar for novice20

hi, using ftplib.storbinary(), i am able to successfully upload files of size 60KB, but not of size 7,218 KB and also 26 KB... I am wondering why is this happening??? should file sizes be a multiple of 10...or what is the actual problem??????????? any reply would be greatly helpful....... I …

Member Avatar for Schol-R-LEA
0
134
Member Avatar for novice20

Hi all... I am trying to upload 4 files on a local disk, onto a remote ftp server. All of them are in the same folder(in local machine). I am using the storbinary function of ftplib. Following are the file sizes: 1-- 70 KB 2-- 60 KB 3-- 73 KB …

Member Avatar for novice20
0
118
Member Avatar for novice20

Hi all, i have different modules developed so far, and a main script needs to call the modules based on user's choice. will doing like this work?? using raw_input(), i wait for user choice, and once a choice is made, corresponding module is called. if main.py, does an 'import xxx.py' …

Member Avatar for novice20
0
190
Member Avatar for novice20

Hi all, Here is a part of my code: [CODE]#-- if the ports are mapped properly if(map_dict1[int(MIO_outports1[i])] == int(Exp_map_inport[i]) ): flag = 1 elif(map_dict2[int(MIO_outports1[i])] == int(Exp_map_inport[i])): flag = 1 else: flag = 0 [/CODE] But I am not able to navigate to the 'elif' part. I am getting : [CODE] …

Member Avatar for TrustyTony
0
277
Member Avatar for novice20

Hi, I want to do something like this: I have two lists: list1 = range(6) list2 = range(10,15) i want a dictionary like this: adict ={0:10, 1:11, 2:12, 3:13, 4:14, 5:15 } I did the following: [CODE]list1 = range(6) list2 = range(10,15) adict = dict(zip(list1,list2))[/CODE] i get : [B]TypeError: list …

Member Avatar for novice20
0
232
Member Avatar for novice20

Hello, can anyone help me regarding how this can be done? I need to declare an 'array' which has 95 indices, and each entry holds 8 bits each of data. am doing this with: PORT_MAP_LEN = 764/8 bit_map_len = [0]*PORT_MAP_LEN but it is giving me list index out of range …

Member Avatar for novice20
0
521
Member Avatar for novice20

Hi, I am working with [B]python2.4 on windows[/B], and want pysnmp to be imported. Have downloaded [B]pysnmp-4.1.14a.tar.gz[/B] and [B]pyasn1-0.0.12a.tar.gz[/B] and put it under [B]D:\Python24\Lib\site-packages\[/B]. Still i am getting the import error. from pysnmp.entity.rfc3413.oneliner import cmdgen ImportError: No module named pysnmp.entity.rfc3413.oneliner What should I do to make pysnmp importable?

Member Avatar for snippsat
0
2K
Member Avatar for novice20

Hi all, I need to set some variables via Pysnmp which take 'unsigned int' only. Is python int by default a 32 bit- signed int? How do I convert it into 16 and 8 bit- unsigned ints? I need to read two registers consequently( which are of 8 bits each) …

Member Avatar for vegaseat
0
9K
Member Avatar for novice20

Hi all, Is there any way to do forward referencing or function prototyping in python..? Being an interpreted language, is lack of forward referencing a drawback of python?

Member Avatar for novice20
0
4K
Member Avatar for novice20

using pysnmp I am querying a variable which gives the IP address. I want to check that address. I do the following [CODE] ........... ............ ............. errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( cmdgen.CommunityData('xxx', 'yyy', 1), cmdgen.UdpTransportTarget((addr,161)), ((1,3,6,1,4,1,18489,1,2,2,2,9,30,0))) print"Error on GET for ccmSDIDULinkUtilEastRemoteIP -%s,%s%(errorIndication,errorStatus) print varBinds print varBinds[0][1] [/CODE] i get …

Member Avatar for novice20
0
199
Member Avatar for novice20

hi all.. I need to issue a 'ping' to an ip address via my script and check whether it is up? can I issue it using os.system? can I capture the output and analyze to see if the host is up??

Member Avatar for novice20
0
2K
Member Avatar for novice20

Hi, I get the log messages 'twice' on the console and only once in the log file. Can any one tell me the reason for this duplication on console? here is how I have set the logger: [ICODE]import logging #--set up logging to file logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', datefmt='%Y-%m-%d …

Member Avatar for novice20
0
103
Member Avatar for novice20

Hi, I have a for loop something like: [CODE]for n in range(no_of_rows): #--configuring ODU Op mode odu_op_mod=list1[n] odu_op_mode= odu_enum["%s"%odu_op_mod] if (odu_op_mod == 'blahblah'): #------------ elif(odu_op_mod == 'aaa'): #-------- elif(odu_op_mode =='xxx'): #----- elif(odu_op_mod == 'yyy'): #------------------- elif(odu_op_mod == 'zzz'): #------------- logging.info("*******************************************************************") subprocess.call(['python link_config_idu12.py %s'%addr],shell=True) [/CODE] I have different lists, list1 #for …

Member Avatar for novice20
0
3K
Member Avatar for novice20

I want 1.py to call 2.py. 1.py takes an Ip address as a command line argument. I am trying a '[B]subprocess.call()[/B]' in 1.py to call 2.py. I have defined addr= sys.argv[1] before the [B]main()[/B] of 1.py. I want the same address to be accessed in 2.py. In short, 1.py should …

Member Avatar for slate
0
180
Member Avatar for novice20

Hi, in the pysnmp tutorial, I couldn't find an equivalent for snmpwalk. What can be used?

0
55
Member Avatar for novice20

hi... using pysnmp, an 'snmp get' varBinds gives me an 'octet string' of values like: 1+1 Protection; East-West; Spiral Search; ODU Enable/Disable I need to loop through these strings and see whether a particular string say, 'East-West' is present. I am not finding way to do this. can this octet …

Member Avatar for LoveMyPadres
0
2K
Member Avatar for novice20

[B]hi all using telnetlib, I am issuing a 'top' command on a remote host. Top seems to continue indefinitely. On a terminal, I can use CTRL+c to suspend the process... What can be passed in telnet.write() equivalently to suspend the process , yet retain the output so far... pls help …

Member Avatar for novice20
0
767
Member Avatar for novice20

[B]hi, my problem is as such... I am establishing a telnet session to an IP using telnetlib module. I read the free memory on the board using telnet.write("free\n"). after this i call a system command 'snmpwalk' to walk the MIBs of the IP above. I again need to establish the …

Member Avatar for novice20
0
113
Member Avatar for novice20

Hi... I have a set of strings as below: [CODE]4:14.4-17M,5:14.4-2e13M,6:14.4-4e9M,7:14.4-8e,22:28.4-35M,23:28.4-2e30M,24:28.4-4e26M,25:28.4-8e18M,26:28.4-16e2M,27:28.4-18e,28:14.16-36M,29:14.16-2e32M,30:14.16-4e28M,31:14.16-8e20M[/CODE] I want everything after the ':' to be discarded. i.e., i just want a list of what preceeds ':' (4,5,6,7,22,.................) How can this be done?

Member Avatar for novice20
0
109
Member Avatar for novice20

can anyone suggest a simple method to define an enum in python. as some examples floating on net, i used class Animal: DOG=1 CAT=2 print Animal.DOG but it doesn't seem to be working...

Member Avatar for novice20
0
126
Member Avatar for novice20

telnetlib is helping me to connect to remote host and do the user login. but, when i try doing the super user login, it hangs ............... .............. ............... User="abc" Password="abc" Superuser_id="yyy" su_passwd="xxx" #-- establish a telnet connection to all the remote hosts in the list except the host running script …

Member Avatar for Simplified
0
174
Member Avatar for novice20

hi, I just came accross the csv module to deals with csv files in python. suppose my csv file has two rows: 1,2,3,4 5,6,7,8 and i want to access each item at a time, i.e., 1 followed by 2 and so on....what can be done? [B]import csv reader= csv.reader(open('filename.csv','r'),delimiter=' ') …

Member Avatar for richieking
0
266
Member Avatar for novice20

[B]$? in linux gives the exit status of the recently executed command , as i have learnt. suppose i give a cd command at the terminal and if such a directory or file is not present, echo $? following it gives me 1. but, when the same is run via …

Member Avatar for novice20
0
132
Member Avatar for novice20

I need to install python 2.4 on a fedora 3 system. I followed the instructions in [B][url]http://www.python.org/download/releases/2.4/rpms/[/url][/B] i have the following contents in [B]/etc/yum.repos.d/python24.repo[/B] [B][python24] name=Fedora Core 3 - $basearch - Python 2.4 baseurl=http://www.python.org/ftp/python/2.4/rpms/fedora-3/ enabled=1 gpgcheck=1[/B] further following the instructions, [B]rpm --import [url]http://www.python.org/ftp/python/2.4/rpms/KRUD-GPG-KEY[/url][/B] gave me: [B]error: [url]http://www.python.org/ftp/python/2.4/rpms/KRUD-GPG-KEY:[/url] import read failed.[/B] …

0
48
Member Avatar for novice20

[B]hi.... i created a telnet connection to a remote server using telnetlib and excuted few commands using telnet.write. can't a python script residing on the remote host be run using telnet.write? i.e, do something like telnet.write("./script_name.py argument1 arguement2........") after the connection is established?[/B]

Member Avatar for novice20
0
60
Member Avatar for novice20

[B]hi all, can anyone tell me how to open a folder on a remote machine connected on same LAN. I need to open a folder in the form "\\remote_machine\folder1\folder2\folder3"[/B]

Member Avatar for novice20
0
3K
Member Avatar for novice20

hi all, can anyone tell me hoe to open a file from one machine, when the file is present on a remote machine, specifying it's IP address?

Member Avatar for richieking
0
639
Member Avatar for novice20

[B]How to validate an IP Address using python? It should reject the shorter addresses such as 192.168 instead of padding the rest of the bits the address with 0s[/B]

Member Avatar for TrustyTony
0
45
Member Avatar for novice20

[B]when the parser is populated with options using optparse, in a case where an option say 'ip' is to be used twice, I get an OptionConflictError. when the conflict handler was set to "resolve" as suggested in [URL="http://docs.python.org/library/optparse.html"]http://docs.python.org/library/optparse.html[/URL] , it resolves the situation by removing '-ip' from the earlier options …

0
52
Member Avatar for novice20

hi... I have written a script for FTP upload using python.. It worked fine when i tried on local boards, but is giving me an error when trying with a remote board via VPN. this is the error i get: [B](104, 'Connection reset by peer')[/B] the machine i developed script …

Member Avatar for novice20
0
1K
Member Avatar for novice20

can anyone show a small sample of how [B]optparse module[/B] can be used to parse a command line arguement? the command line is somewhat like: <scriptname> -ip<ip address> -opt1/opt2

Member Avatar for Gribouillis
0
63
Member Avatar for novice20
Member Avatar for vaibhav1983
0
72
Member Avatar for novice20

I have python 2.5.2 on my Debian system n want to upgrade it to python 2.6. Got to know that apt-get install package searches for package in /etc/apt/sources.list I have downloaded python 2.6.2. How to add an entry to the file /etc/apt/sources.list ? :(

Member Avatar for npmaier
0
178
Member Avatar for novice20

below is how an snmp get is issued using pysnmp errorIndication,errorStatus,errorIndex,varBinds = cmdgen.CommandGenerator().getCmd( cmdgen.CommunityData('xxxx', 'xxxx', 1), cmdgen.UdpTransportTarget(('192.168.5.157', 161)), (1,3,6,1,4,1,18489,1,2,1,4,5,[B]1[/B],0)) In the OID part, the integer in bold keeps changing from 1 to 38. I need to put the above in a loop, instead of issuing 38 seperate gets. how can …

0
65
Member Avatar for novice20

[B]hi... I have a value, value=4501-E001 I am concerned about only the value before hyphen i.e., 4501 I need to check whether various values begin with 4501, followed by something, n am not concerned about "something" that follows. How can this splitting be done in python?[/B]

Member Avatar for Gribouillis
0
131
Member Avatar for novice20

hi... how can this be done using python 1.prompting user for a file location from within a script 2.reading the file location entered by the user 3.storing it in a file like object

Member Avatar for novice20
0
84
Member Avatar for novice20

hi... am using pysnmp module to do an snmp get on a USB key status from pysnmp.entity.rfc3413.oneliner import cmdgen #--query on ccmSDIDUKeyStatus errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( cmdgen.CommunityData('xxx', 'xxx', 1), cmdgen.UdpTransportTarget(('192.168.5.157', 161)), (1,3,6,1,4,1,18489,1,2,4,2,8,0)) varBinds gives the following: [(ObjectName('1.3.6.1.4.1.18489.1.2.4.2.8.0'), Integer('2'))] I need to print the key status, based on varBinds, …

Member Avatar for novice20
0
993
Member Avatar for novice20

Is there any method or library to translate pysnmp OIDs to human readable strings??

0
61
Member Avatar for novice20

hi...i am trying to install python 2.6 on my debian system.. I followed the following instructions[B] [url]http://www.fps-gamer.net/installing-python-2-6-on-debian-lenny/[/url] [/B] on doing [B]aptitude install -t testing python-central[/B] i get [B]E: Invalid record in the preferences file, no Package header[/B] can any body pls reason out:(

Member Avatar for Gribouillis
0
792
Member Avatar for novice20

I want some insight into /etc/apt/preferences and /etc/apt/sources.list file on debian

Member Avatar for Gribouillis
0
45
Member Avatar for novice20

while trying to install net-snmp-5.6, i get following error [B]gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.5 -c netsnmp/client_intf.c -o build/temp.linux-i686-2.5/netsnmp/client_intf.o netsnmp/client_intf.c:1:20: error: Python.h: No such file or directory In file included from /usr/local/include/net-snmp/net-snmp-includes.h:69, from netsnmp/client_intf.c:4:[/B] my debian system has python2.5.2 where can I find Python.h header …

Member Avatar for Gribouillis
0
572
Member Avatar for novice20

hi.... I am doing an snmpwalk on MIB variables and dumping the output to a text file. I dont need all the info and need to read only a part of it. How can this be done efficiently in python?

Member Avatar for ptmcg
0
231
Member Avatar for novice20

i have a problem... within my python script which does an snmpwalk, there should be an intelligence to create a static table which maps OIDs to corresponding text strings, query the table and in the output of snmpwalk, i need to replace the numeric string with its textual string.. for …

Member Avatar for woooee
0
120
Member Avatar for novice20

while trying to configure yapsnmp-0.7.8, i get the following.. checking for patch... patch checking for kstat_open in -lkstat... no checking for socket in -lsocket... no checking for HMAC in -lcrypto... no checking for init_snmp in -lsnmp... no configure: error:[B] Couldn't find libsnmp [/B] what might be the reason?

Member Avatar for novice20
0
167
Member Avatar for novice20

hi... is there any MIB parsing tool which generates an excel file or like that can be queried?

Member Avatar for jice
0
49
Member Avatar for novice20

hi all... whats the difference between os.popen and subprocess.popen?? what does shell=True in subprocess.call really mean? if os.popen is used for snmpwalk, will there be any problem such as exceeding pipe capacity? what is the capacity of the file objcet connected to pipe using os.popen?/ how much data can it …

Member Avatar for Gribouillis
0
140
Member Avatar for novice20

hi all can u pls help me regarding iterating through an integer variable within a subprocess call here is what i exactly want to do for n in range(1,16): subprocess.call(['snmpset', '-v2c', '-c arct1c', '192.168.5.157', '.1.3.6.1.4.1.18489.1.2.1.5.1.2.0', 'i ','n']) i.e., i want to iterate through snmpwalk..but its not working:( it shows 'bad …

Member Avatar for Gribouillis
0
129
Member Avatar for novice20

can anyone help me regarding how multiple snmp sets can be invoked in python within a for loop?

0
67

The End.