Skip to content

Conversation

@MRichards99
Copy link

This pull request includes the development for the script as well as a README to understand how to use it. The script shouldn't need any changes functionality wise (it's been used with the spreadsheet for a few weeks and relevant changes have been made during this time), which is why I'm opening a pull request at this stage.

Files introduced by IDE
First commit of this file:
- Works out which row to append from
- Few inital lines to extract data from TSV file
Cleanup of code from previous commit:
- Sections of code moved around to suit where they're needed (not used until a certain point)
- General code improvement, little things
- Basic functionality now works, data is taken from TSV file and appended to the spreadsheet
- Needs lots of cleanup regarding formatting, loss of excel formulas etc.
No reason for this to occur, xlrd takes this role
- Script now using openpyxl module instead of xlrd because xlrd erased formulas upon saving spreadsheet
- This now means OnCall spreadsheet must be .xlsx file to work with the script
- State of script in this commit: working, formulas don't erase
- Working hours conditional formatting doesn't work as the ticket creation time hasn't been split (one variable containing date, another containing the time)
- Script now manipulates .xlsx files
- Separates them for the two cells in the spreadsheet
- The 'outside work hours?' formatting still not working - if time created is doubled clicked in Excel then it works but that's manual
- Once running script, the added 'RT query' cells had an error saying they should be numbers but are text - fixed in this commit
- The same cells were being aligned to the right once I made the above change so are now aligned to centre as per previous spreadsheet use
- Hyperlink is added to each ticket ID to point at ticket on RT
- Thin border for all cells created
- Thick outer border for the cells added also created
- Layout of code slightly changed
- This will mean the spreadsheet won't need to be corrected due to merged tickets and subjects updated (e.g. ceph-mon1-5 tickets)
- Due to the change to the 'with' statement above, you can no longer say both files can be found at this stage in the code
- Will add to 'Service' column when you can tell what service the alarm refers to
- Currently implemented for: CEPH, CE and DISK Server services
- Uses alarm to search for keywords
- Text will be wrapped on all cells for rows being written to during execution of the script
- Name of host added under the host column (to the relevant row) if it can be identified from the alarm name
- Better comments
- Constants added for filenames and sheet name for things that will definitely end up changing over time
- Try and except blocks setup for missing Callouts.xlsx and missing sheet in that file
- Few bits of code cleanup to improve readability
- Added try except block on with open statement
- Instructions to use the script added as well as a couple of changes
- If subject didn't include 'and cleared', the Nagios filler would still remain in the alarm name
- This generalises nagiosFiller and searches for the first 'T' (for Tier 1) to remove Nagios filler
- README made clearer to understand
- RT custom search easier to put into RT (more like RT language used)
@JHaydock-Pro JHaydock-Pro mentioned this pull request Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant