Oct-20-2023, 02:54 PM
ok, so i have a script that pings all our registers in the company to check if they are online or offline.. this works great. that script works off a list of just ip's. Once the script runs, it generates a output file in csv with the ip, status, datetime. Currently this is being pulled into excel to create a dashboard. NOW that VP's and management is aware of this dashboard, they want access, but providing access to so many people and one excel file, the file is going to get manipulated and eventually break. So im working on a new script that i can do everything im already doing in excel, but within the script to then generate a static report that can be sent out to everyone and no worry about pivot tables being changed or excel file being updated or changed and causing issues.
So i have a dataframe that returns a list of the ip's with store # and register number (source data) in the new script, this will be used as the source for IP's to ping. So in excel im using vlookup, how can i accomplish the same thing and add the store # and Register # to my csv of results?
Here is my source data that will be used to pull the ip, but also contains the store and register that i need to include in my results.csv
# SOURCE DATAFRAME
So i have a dataframe that returns a list of the ip's with store # and register number (source data) in the new script, this will be used as the source for IP's to ping. So in excel im using vlookup, how can i accomplish the same thing and add the store # and Register # to my csv of results?
Here is my source data that will be used to pull the ip, but also contains the store and register that i need to include in my results.csv
# SOURCE DATAFRAME
Output: IP Store Register
0 121.11.7.203 7 203
1 121.11.7.204 7 204
2 121.11.7.205 7 205
3 121.11.7.206 7 206
4 121.11.7.207 7 207
5 121.11.7.208 7 208
6 121.11.7.221 7 221
7 121.11.7.222 7 222
8 121.11.9.201 9 201
9 121.11.9.202 9 202
10 121.11.9.203 9 203
11 121.11.9.204 9 204
# RESULTS DATAFRAME THAT IS WRITTEN TO CSVOutput: IP Status Datetime
0 121.11.7.203 0 10/18/2023,16:12:01
1 121.11.7.204 0 10/18/2023,16:12:01
2 121.11.7.205 0 10/18/2023,16:12:01
3 121.11.7.206 0 10/18/2023,16:12:01
4 121.11.7.207 0 10/18/2023,16:12:01
5 121.11.7.208 0 10/18/2023,16:12:01
6 121.11.7.221 1 10/18/2023,16:12:01
7 121.11.7.222 0 10/18/2023,16:12:01
8 121.11.9.201 0 10/18/2023,16:12:01
9 121.11.9.202 0 10/18/2023,16:12:01
10 121.11.9.203 0 10/18/2023,16:12:01
11 121.11.9.204 0 10/18/2023,16:12:01
Since the results are captured into a df as they are gathered, then written to csv, i would like to add the store and register into the results before writing the csv. How can i search the source for the ip and return the 2 additional values i want and add to the results df?