[root@localhost ~]# cat test_nothread.py
import paramiko
import threading
import os
def ssh2(ip,username,passwd,cmd):
file_path='/root/perror.log'
logfile=file(file_path,'a')
try:
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip,22,username,passwd,timeout=5)
for m in cmd:
stdin, stdout, stderr = ssh.exec_command(m)
# stdin.write("Y")
out = stdout.readlines()
for o in out:
# print o
logfile.write(o)
# print '%s\tOK\n'%(ip)
ssh.close()
except :
print '%s\tError\n'%(ip)
logfile.close()
if __name__=='__main__':
username = "root"
passwd = "admin1"
threads = []
print "Begin......"
for i in range(1,20000):
ip = '192.168.1.113'
cmd1 ='perror '+str(i)
cmd = [cmd1]
# print i
ssh2(ip,username,passwd,cmd);
OS error code 1: Operation not permitted
OS error code 2: No such file or directory
OS error code 3: No such process
OS error code 4: Interrupted system call
OS error code 5: Input/output error
OS error code 6: No such device or address
OS error code 7: Argument list too long
OS error code 8: Exec format error
OS error code 9: Bad file descriptor
OS error code 10: No child processes
OS error code 11: Resource temporarily unavailable
OS error code 12: Cannot allocate memory
OS error code 13: Permission denied
OS error code 14: Bad address
OS error code 15: Block device required
OS error code 16: Device or resource busy
OS error code 17: File exists
OS error code 18: Invalid cross-device link
OS error code 19: No such device
OS error code 20: Not a directory
OS error code 21: Is a directory
OS error code 22: Invalid argument
OS error code 23: Too many open files in system
OS error code 24: Too many open files
OS error code 25: Inappropriate ioctl for device
OS error code 26: Text file busy
OS error code 27: File too large
OS error code 28: No space left on device
OS error code 29: Illegal seek
OS error code 30: Read-only file system
OS error code 31: Too many links
OS error code 32: Broken pipe
OS error code 33: Numerical argument out of domain
OS error code 34: Numerical result out of range
OS error code 35: Resource deadlock avoided
OS error code 36: File name too long
OS error code 37: No locks available
OS error code 38: Function not implemented
OS error code 39: Directory not empty
OS error code 40: Too many levels of symbolic links
OS error code 42: No message of desired type
OS error code 43: Identifier removed
OS error code 44: Channel number out of range
OS error code 45: Level 2 not synchronized
OS error code 46: Level 3 halted
OS error code 47: Level 3 reset
OS error code 48: Link number out of range
OS error code 49: Protocol driver not attached
OS error code 50: No CSI structure available
OS error code 51: Level 2 halted
OS error code 52: Invalid exchange
OS error code 53: Invalid request descriptor
OS error code 54: Exchange full
OS error code 55: No anode
OS error code 56: Invalid request code
OS error code 57: Invalid slot
OS error code 59: Bad font file format
OS error code 60: Device not a stream
OS error code 61: No data available
OS error code 62: Timer expired
OS error code 63: Out of streams resources
OS error code 64: Machine is not on the network
OS error code 65: Package not installed
OS error code 66: Object is remote
OS error code 67: Link has been severed
OS error code 68: Advertise error
OS error code 69: Srmount error
OS error code 70: Communication error on send
OS error code 71: Protocol error
OS error code 72: Multihop attempted
OS error code 73: RFS specific error
OS error code 74: Bad message
OS error code 75: Value too large for defined data type
OS error code 76: Name not unique on network
OS error code 77: File descriptor in bad state
OS error code 78: Remote address changed
OS error code 79: Can not access a needed shared library
OS error code 80: Accessing a corrupted shared library
OS error code 81: .lib section in a.out corrupted
OS error code 82: Attempting to link in too many shared libraries
OS error code 83: Cannot exec a shared library directly
OS error code 84: Invalid or incomplete multibyte or wide character
OS error code 85: Interrupted system call should be restarted
OS error code 86: Streams pipe error
OS error code 87: Too many users
OS error code 88: Socket operation on non-socket
OS error code 89: Destination address required
OS error code 90: Message too long
OS error code 91: Protocol wrong type for socket
OS error code 92: Protocol not available
OS error code 93: Protocol not supported
OS error code 94: Socket type not supported
OS error code 95: Operation not supported
OS error code 96: Protocol family not supported
OS error code 97: Address family not supported by protocol
OS error code 98: Address already in use
OS error code 99: Cannot assign requested address
OS error code 100: Network is down
OS error code 101: Network is unreachable
OS error code 102: Network dropped connection on reset
OS error code 103: Software caused connection abort
OS error code 104: Connection reset by peer
OS error code 105: No buffer space available
OS error code 106: Transport endpoint is already connected
OS error code 107: Transport endpoint is not connected
OS error code 108: Cannot send after transport endpoint shutdown
OS error code 109: Too many references: cannot splice
OS error code 110: Connection timed out
OS error code 111: Connection refused
OS error code 112: Host is down
OS error code 113: No route to host
OS error code 114: Operation already in progress
OS error code 115: Operation now in progress
OS error code 116: Stale file handle
OS error code 117: Structure needs cleaning
OS error code 118: Not a XENIX named type file
OS error code 119: No XENIX semaphores available
OS error code 120: Is a named type file
MySQL error code 120: Didn't find key on read or update
OS error code 121: Remote I/O error
MySQL error code 121: Duplicate key on write or update
OS error code 122: Disk quota exceeded
MySQL error code 122: Internal (unspecified) error in handler
OS error code 123: No medium found
MySQL error code 123: Someone has changed the row since it was read (while the table was locked to prevent it)
OS error code 124: Wrong medium type
MySQL error code 124: Wrong index given to function
OS error code 125: Operation canceled
MySQL error code 125: Undefined handler error 125
OS error code 126: Required key not available
MySQL error code 126: Index file is crashed
OS error code 127: Key has expired
MySQL error code 127: Record file is crashed
OS error code 128: Key has been revoked
MySQL error code 128: Out of memory in engine
OS error code 129: Key was rejected by service
MySQL error code 129: Undefined handler error 129
OS error code 130: Owner died
MySQL error code 130: Incorrect file format
OS error code 131: State not recoverable
MySQL error code 131: Command not supported by database
OS error code 132: Operation not possible due to RF-kill
MySQL error code 132: Old database file
MySQL error code 133: No record read before update
MySQL error code 134: Record was already deleted (or record file crashed)
MySQL error code 135: No more room in record file
MySQL error code 136: No more room in index file
MySQL error code 137: No more records (read after end of file)
MySQL error code 138: Unsupported extension used for table
MySQL error code 139: Too big row
MySQL error code 140: Wrong create options
MySQL error code 141: Duplicate unique key or constraint on write or update
MySQL error code 142: Unknown character set used in table
MySQL error code 143: Conflicting table definitions in sub-tables of MERGE table
MySQL error code 144: Table is crashed and last repair failed
MySQL error code 145: Table was marked as crashed and should be repaired
MySQL error code 146: Lock timed out; Retry transaction
MySQL error code 147: Lock table is full; Restart program with a larger locktable
MySQL error code 148: Updates are not allowed under a read only transactions
MySQL error code 149: Lock deadlock; Retry transaction
MySQL error code 150: Foreign key constraint is incorrectly formed
MySQL error code 151: Cannot add a child row
MySQL error code 152: Cannot delete a parent row
MySQL error code 153: No savepoint with that name
MySQL error code 154: Non unique key block size
MySQL error code 155: The table does not exist in engine
MySQL error code 156: The table already existed in storage engine
MySQL error code 157: Could not connect to storage engine
MySQL error code 158: Unexpected null pointer found when using spatial index
MySQL error code 159: The table changed in storage engine
MySQL error code 160: There's no partition in table for the given value
MySQL error code 161: Row-based binlogging of row failed
MySQL error code 162: Index needed in foreign key constraint
MySQL error code 163: Upholding foreign key constraints would lead to a duplicate key error in some other table
MySQL error code 164: Table needs to be upgraded before it can be used
MySQL error code 165: Table is read only
MySQL error code 166: Failed to get next auto increment value
MySQL error code 167: Failed to set row auto increment value
MySQL error code 168: Unknown (generic) error from engine
MySQL error code 169: Record is the same
MySQL error code 170: It is not possible to log this statement
MySQL error code 171: The event was corrupt, leading to illegal data being read
MySQL error code 172: The table is of a new format not supported by this version
MySQL error code 173: The event could not be processed no other hanlder error happened
MySQL error code 174: Got a fatal error during initialzaction of handler
MySQL error code 175: File to short; Expected more data in file
MySQL error code 176: Read page with wrong checksum
MySQL error code 177: Too many active concurrent transactions
MySQL error code 178: Record not matching the given partition set
MySQL error code 179: Index column length exceeds limit
MySQL error code 180: Index corrupted
MySQL error code 181: Undo record too big
MySQL error code 182: Invalid InnoDB FTS Doc ID
MySQL error code 183: Table is being used in foreign key check
MySQL error code 184: Tablespace already exists
MySQL error code 185: Too many columns
MySQL error code 186: Row in wrong partition
MySQL error code 187: InnoDB is in read only mode
MySQL error code 188: FTS query exceeds result cache memory limit
MySQL error code 189: Temporary file write failure
MySQL error code 190: Operation not allowed when innodb_forced_recovery > 0
MySQL error code 191: Too many words in a FTS phrase or proximity search
MySQL error code 1000 (ER_HASHCHK): hashchk
MySQL error code 1001 (ER_NISAMCHK): isamchk
MySQL error code 1002 (ER_NO): NO
MySQL error code 1003 (ER_YES): YES
MySQL error code 1004 (ER_CANT_CREATE_FILE): Can't create file '%-.200s' (errno: %d - %s)
MySQL error code 1005 (ER_CANT_CREATE_TABLE): Can't create table '%-.200s' (errno: %d)
MySQL error code 1006 (ER_CANT_CREATE_DB): Can't create database '%-.192s' (errno: %d)
MySQL error code 1007 (ER_DB_CREATE_EXISTS): Can't create database '%-.192s'; database exists
MySQL error code 1008 (ER_DB_DROP_EXISTS): Can't drop database '%-.192s'; database doesn't exist
MySQL error code 1009 (ER_DB_DROP_DELETE): Error dropping database (can't delete '%-.192s', errno: %d)
MySQL error code 1010 (ER_DB_DROP_RMDIR): Error dropping database (can't rmdir '%-.192s', errno: %d)
MySQL error code 1011 (ER_CANT_DELETE_FILE): Error on delete of '%-.192s' (errno: %d - %s)
MySQL error code 1012 (ER_CANT_FIND_SYSTEM_REC): Can't read record in system table
MySQL error code 1013 (ER_CANT_GET_STAT): Can't get status of '%-.200s' (errno: %d - %s)
MySQL error code 1014 (ER_CANT_GET_WD): Can't get working directory (errno: %d - %s)
MySQL error code 1015 (ER_CANT_LOCK): Can't lock file (errno: %d - %s)
MySQL error code 1016 (ER_CANT_OPEN_FILE): Can't open file: '%-.200s' (errno: %d - %s)
MySQL error code 1017 (ER_FILE_NOT_FOUND): Can't find file: '%-.200s' (errno: %d - %s)
MySQL error code 1018 (ER_CANT_READ_DIR): Can't read dir of '%-.192s' (errno: %d - %s)
MySQL error code 1019 (ER_CANT_SET_WD): Can't change dir to '%-.192s' (errno: %d - %s)
MySQL error code 1020 (ER_CHECKREAD): Record has changed since last read in table '%-.192s'
MySQL error code 1021 (ER_DISK_FULL): Disk full (%s); waiting for someone to free some space... (errno: %d - %s)
MySQL error code 1022 (ER_DUP_KEY): Can't write; duplicate key in table '%-.192s'
MySQL error code 1023 (ER_ERROR_ON_CLOSE): Error on close of '%-.192s' (errno: %d - %s)
MySQL error code 1024 (ER_ERROR_ON_READ): Error reading file '%-.200s' (errno: %d - %s)
MySQL error code 1025 (ER_ERROR_ON_RENAME): Error on rename of '%-.210s' to '%-.210s' (errno: %d - %s)
MySQL error code 1026 (ER_ERROR_ON_WRITE): Error writing file '%-.200s' (errno: %d - %s)
MySQL error code 1027 (ER_FILE_USED): '%-.192s' is locked against change
MySQL error code 1028 (ER_FILSORT_ABORT): Sort aborted
MySQL error code 1029 (ER_FORM_NOT_FOUND): View '%-.192s' doesn't exist for '%-.192s'
MySQL error code 1030 (ER_GET_ERRNO): Got error %d from storage engine
MySQL error code 1031 (ER_ILLEGAL_HA): Table storage engine for '%-.192s' doesn't have this option
MySQL error code 1032 (ER_KEY_NOT_FOUND): Can't find record in '%-.192s'
MySQL error code 1033 (ER_NOT_FORM_FILE): Incorrect information in file: '%-.200s'
MySQL error code 1034 (ER_NOT_KEYFILE): Incorrect key file for table '%-.200s'; try to repair it
MySQL error code 1035 (ER_OLD_KEYFILE): Old key file for table '%-.192s'; repair it!
MySQL error code 1036 (ER_OPEN_AS_READONLY): Table '%-.192s' is read only
MySQL error code 1037 (ER_OUTOFMEMORY): Out of memory; restart server and try again (needed %d bytes)
MySQL error code 1038 (ER_OUT_OF_SORTMEMORY): Out of sort memory, consider increasing server sort buffer size
MySQL error code 1039 (ER_UNEXPECTED_EOF): Unexpected EOF found when reading file '%-.192s' (errno: %d - %s)
MySQL error code 1040 (ER_CON_COUNT_ERROR): Too many connections
MySQL error code 1041 (ER_OUT_OF_RESOURCES): Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
MySQL error code 1042 (ER_BAD_HOST_ERROR): Can't get hostname for your address
MySQL error code 1043 (ER_HANDSHAKE_ERROR): Bad handshake
MySQL error code 1044 (ER_DBACCESS_DENIED_ERROR): Access denied for user '%-.48s'@'%-.64s' to database '%-.192s'
MySQL error code 1045 (ER_ACCESS_DENIED_ERROR): Access denied for user '%-.48s'@'%-.64s' (using password: %s)
MySQL error code 1046 (ER_NO_DB_ERROR): No database selected
MySQL error code 1047 (ER_UNKNOWN_COM_ERROR): Unknown command
MySQL error code 1048 (ER_BAD_NULL_ERROR): Column '%-.192s' cannot be null
MySQL error code 1049 (ER_BAD_DB_ERROR): Unknown database '%-.192s'
MySQL error code 1050 (ER_TABLE_EXISTS_ERROR): Table '%-.192s' already exists
MySQL error code 1051 (ER_BAD_TABLE_ERROR): Unknown table '%-.100s'
MySQL error code 1052 (ER_NON_UNIQ_ERROR): Column '%-.192s' in %-.192s is ambiguous
MySQL error code 1053 (ER_SERVER_SHUTDOWN): Server shutdown in progress
MySQL error code 1054 (ER_BAD_FIELD_ERROR): Unknown column '%-.192s' in '%-.192s'
MySQL error code 1055 (ER_WRONG_FIELD_WITH_GROUP): '%-.192s' isn't in GROUP BY
MySQL error code 1056 (ER_WRONG_GROUP_FIELD): Can't group on '%-.192s'
MySQL error code 1057 (ER_WRONG_SUM_SELECT): Statement has sum functions and columns in same statement
MySQL error code 1058 (ER_WRONG_VALUE_COUNT): Column count doesn't match value count
MySQL error code 1059 (ER_TOO_LONG_IDENT): Identifier name '%-.100s' is too long
MySQL error code 1060 (ER_DUP_FIELDNAME): Duplicate column name '%-.192s'
MySQL error code 1061 (ER_DUP_KEYNAME): Duplicate key name '%-.192s'
MySQL error code 1062 (ER_DUP_ENTRY): Duplicate entry '%-.192s' for key %d
MySQL error code 1063 (ER_WRONG_FIELD_SPEC): Incorrect column specifier for column '%-.192s'
MySQL error code 1064 (ER_PARSE_ERROR): %s near '%-.80s' at line %d
MySQL error code 1065 (ER_EMPTY_QUERY): Query was empty
MySQL error code 1066 (ER_NONUNIQ_TABLE): Not unique table/alias: '%-.192s'
MySQL error code 1067 (ER_INVALID_DEFAULT): Invalid default value for '%-.192s'
MySQL error code 1068 (ER_MULTIPLE_PRI_KEY): Multiple primary key defined
MySQL error code 1069 (ER_TOO_MANY_KEYS): Too many keys specified; max %d keys allowed
MySQL error code 1070 (ER_TOO_MANY_KEY_PARTS): Too many key parts specified; max %d parts allowed
MySQL error code 1071 (ER_TOO_LONG_KEY): Specified key was too long; max key length is %d bytes
MySQL error code 1072 (ER_KEY_COLUMN_DOES_NOT_EXITS): Key column '%-.192s' doesn't exist in table
MySQL error code 1073 (ER_BLOB_USED_AS_KEY): BLOB column '%-.192s' can't be used in key specification with the used table type
MySQL error code 1074 (ER_TOO_BIG_FIELDLENGTH): Column length too big for column '%-.192s' (max = %lu); use BLOB or TEXT instead
MySQL error code 1075 (ER_WRONG_AUTO_KEY): Incorrect table definition; there can be only one auto column and it must be defined as a key
MySQL error code 1076 (ER_READY): %s: ready for connections.
Version: '%s' socket: '%s' port: %d
MySQL error code 1077 (ER_NORMAL_SHUTDOWN): %s: Normal shutdown
MySQL error code 1078 (ER_GOT_SIGNAL): %s: Got signal %d. Aborting!
MySQL error code 1079 (ER_SHUTDOWN_COMPLETE): %s: Shutdown complete
MySQL error code 1080 (ER_FORCING_CLOSE): %s: Forcing close of thread %ld user: '%-.48s'
MySQL error code 1081 (ER_IPSOCK_ERROR): Can't create IP socket
MySQL error code 1082 (ER_NO_SUCH_INDEX): Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table
MySQL error code 1083 (ER_WRONG_FIELD_TERMINATORS): Field separator argument is not what is expected; check the manual
MySQL error code 1084 (ER_BLOBS_AND_NO_TERMINATED): You can't use fixed rowlength with BLOBs; please use 'fields terminated by'
MySQL error code 1085 (ER_TEXTFILE_NOT_READABLE): The file '%-.128s' must be in the database directory or be readable by all
MySQL error code 1086 (ER_FILE_EXISTS_ERROR): File '%-.200s' already exists
MySQL error code 1087 (ER_LOAD_INFO): Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld
MySQL error code 1088 (ER_ALTER_INFO): Records: %ld Duplicates: %ld
MySQL error code 1089 (ER_WRONG_SUB_KEY): Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys
MySQL error code 1090 (ER_CANT_REMOVE_ALL_FIELDS): You can't delete all columns with ALTER TABLE; use DROP TABLE instead
MySQL error code 1091 (ER_CANT_DROP_FIELD_OR_KEY): Can't DROP '%-.192s'; check that column/key exists
MySQL error code 1092 (ER_INSERT_INFO): Records: %ld Duplicates: %ld Warnings: %ld
MySQL error code 1093 (ER_UPDATE_TABLE_USED): You can't specify target table '%-.192s' for update in FROM clause
MySQL error code 1094 (ER_NO_SUCH_THREAD): Unknown thread id: %lu
MySQL error code 1095 (ER_KILL_DENIED_ERROR): You are not owner of thread %lu
MySQL error code 1096 (ER_NO_TABLES_USED): No tables used
MySQL error code 1097 (ER_TOO_BIG_SET): Too many strings for column %-.192s and SET
MySQL error code 1098 (ER_NO_UNIQUE_LOGFILE): Can't generate a unique log-filename %-.200s.(1-999)
MySQL error code 1099 (ER_TABLE_NOT_LOCKED_FOR_WRITE): Table '%-.192s' was locked with a READ lock and can't be updated
MySQL error code 1100 (ER_TABLE_NOT_LOCKED): Table '%-.192s' was not locked with LOCK TABLES
MySQL error code 1101 (ER_BLOB_CANT_HAVE_DEFAULT): BLOB/TEXT column '%-.192s' can't have a default value
MySQL error code 1102 (ER_WRONG_DB_NAME): Incorrect database name '%-.100s'
MySQL error code 1103 (ER_WRONG_TABLE_NAME): Incorrect table name '%-.100s'
MySQL error code 1104 (ER_TOO_BIG_SELECT): The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
MySQL error code 1105 (ER_UNKNOWN_ERROR): Unknown error
MySQL error code 1106 (ER_UNKNOWN_PROCEDURE): Unknown procedure '%-.192s'
MySQL error code 1107 (ER_WRONG_PARAMCOUNT_TO_PROCEDURE): Incorrect parameter count to procedure '%-.192s'
MySQL error code 1108 (ER_WRONG_PARAMETERS_TO_PROCEDURE): Incorrect parameters to procedure '%-.192s'
MySQL error code 1109 (ER_UNKNOWN_TABLE): Unknown table '%-.192s' in %-.32s
MySQL error code 1110 (ER_FIELD_SPECIFIED_TWICE): Column '%-.192s' specified twice
MySQL error code 1111 (ER_INVALID_GROUP_FUNC_USE): Invalid use of group function
MySQL error code 1112 (ER_UNSUPPORTED_EXTENSION): Table '%-.192s' uses an extension that doesn't exist in this MySQL version
MySQL error code 1113 (ER_TABLE_MUST_HAVE_COLUMNS): A table must have at least 1 column
MySQL error code 1114 (ER_RECORD_FILE_FULL): The table '%-.192s' is full
MySQL error code 1115 (ER_UNKNOWN_CHARACTER_SET): Unknown character set: '%-.64s'
MySQL error code 1116 (ER_TOO_MANY_TABLES): Too many tables; MySQL can only use %d tables in a join
MySQL error code 1117 (ER_TOO_MANY_FIELDS): Too many columns
MySQL error code 1118 (ER_TOO_BIG_ROWSIZE): Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
MySQL error code 1119 (ER_STACK_OVERRUN): Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld --thread_stack=#' to specify a bigger stack if needed
MySQL error code 1120 (ER_WRONG_OUTER_JOIN): Cross dependency found in OUTER JOIN; examine your ON conditions
MySQL error code 1121 (ER_NULL_COLUMN_IN_INDEX): Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler
MySQL error code 1122 (ER_CANT_FIND_UDF): Can't load function '%-.192s'
MySQL error code 1123 (ER_CANT_INITIALIZE_UDF): Can't initialize function '%-.192s'; %-.80s
MySQL error code 1124 (ER_UDF_NO_PATHS): No paths allowed for shared library
MySQL error code 1125 (ER_UDF_EXISTS): Functio