Python-portal application status check script, python-Portal

Source: Internet
Author: User

Python-portal application status check script, python-Portal
This week, a portal application status check script was implemented using python. The main function is to quickly collect application status, automatically collect the status of Preset checkpoints, and improve the problem locating efficiency when exceptions occur. The following functions have been implemented: 1. Process Check 2. GC check 3. PV check in peak seconds 4. TCP Connection check 5. Load check 6. system error Ticket check 7. watchdog status check 8. Storage usage 9. Difficulties in error log Verification: 1. python parses the shell command execution result. To determine whether the result is normal, you need to parse the data into an array or dictionary tip. Summary: 1. parse the shell execution result and return the dictionary object.

12345678910111213141516171819202122232425262728293031 # Resolving the title + returning dict objects with multiple rows of datadef resolving_shell_table_data_line(ckeys,cvalue):    """    ckeys= "mountpoint  free  used"    cvalue = "    /dev/sda2 9.0G 5%    /dev/sda3 4.5G 4%    /dev/sda7 18G 50%"     return    [    {'mountpoint':'/dev/sda2','free':'9.0G','used':'5%'},    {'mountpoint':'/dev/sda3','free':'4.5G','used':'4%'},    {'mountpoint':'/dev/sda7','free':'18G','used':'50%'},    ]    """     keys=[i for in ckeys.replace("\n","").split(" ") if i!=""]     res = []    for in cvalue:        p1=[i for in p.replace("\n","").split(" ") if i!=""]         if len(p1)!=len(keys):            log("error data ")            log(cvalue)            log(keys)        else:            res.append(dict(zip(keys,p1)))                 return res     
2. convert text to numbers
1 string.atof(item['used'].replace("%",""))
Less than 1. The current code reuse rate is not high, reaching 352 rows; 2. Plug-ins are not implemented to add new functions; prospect 1. Optimized to plug-in development methods and defined plug-in specifications, the availability and scalability of the script can be increased;



From Weizhi note (Wiz)




Python script to open the application

1. Open QQ through the path
2. query the registry key = win32api. regOpenKey (win32con. HKEY_CURRENT_USER, 'soft', 0, win32con. KEY_READ) print keyimport osos. startfile ("E: \ QQ \ Bin \ QQ.exe ")

How can I use the python script language to write a window program?

It can be developed using qt or tkinter.
You can also use ironpython + wpf

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.