Logging Aggregator and Reporting For a Chain


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Logging Aggregator and Reporting For a Chain
# 1  
Old 09-26-2014
Logging Aggregator and Reporting For a Chain

Hello,
I'am lerning Powershell and have this task. can anyone help?
Imagine a fitness studio chain that operates different studios in Munich. Every studio has been given a Windows server that operates the entry of studio clients via a key-card (NFC) and it also operates the cashier at the bar where beverages are and snacks are sold.
The management of the chain wants to get a better overview of the daily activity in all of their studios (4 at the moment and a 5th one being prepared for the grand opening). Therefore you have been given the task to retrieve the log files from each of the servers copy them to a central aggregation server, read those files, merge them if necessary and send an email with a report once a day to the management.



Servers The following servers are in operation at the moment
Code:
\\Leopoldstrasse
\\Wittelsbacherplatz
\\Marienplatz
\\Sonnenstrasse

Every of these servers has a user names “Aggregator” which has the password “gimme_data” and which has the rights to read the log files.
  • Services Each server runs 2 services
    • Check-In – writes a log-entry for each “check-in” of a client
    • Cashier – writes a log-entry for each sale at the bar
  • Log Files
    • Each services creates a rolling file for the actual hour and writes all the log entries during this hour into this file. At the beginning of a new hour a new file is created and then used for writing the log entries into it. So for every day you will have a maximum of 24 log files per service (a total of max 48 log files for 2 services)
    • The log files for the checkin can be found at this relative path c:\logs\sevices\check-in\<reverse-date>\<hour[always 2 digits]>.txt Example: for the studio at Leopoldstrasse you will find the file for the cashier for the period of September 10th 2014 from 15:00 to 15:59:59 at \\Leopoldstrasse\C\logs\services\cashier\2014-09-10\15.txt
  • Logging Entries The logging entries have the following format
    • Check-in => <timestamp>,<user-id-read-from-key-card><CR> Example: 14:34:51, 2932 14:39:22, 1922 15:12:09, 0976
    • Cashier => <time-stamp>, <user-id>, <beverage|snack>, <amount><CR> Example: 16:34:51, 2235, beverage, 13.12 17:23:22, 0127, snack, 7.23 17:48:09, 0976, beverage, 17.91
Line endings are denoted by <CR Carriage Return>. Fields are split by commas
  • Aggregation Server The aggregation servers has the following tasks
    • Copy each file from each of the servers to the aggregation server itself.
    • The path to copy the files is the same as on the original servers => path c:\logs\sevices\check-in\<reverse-date>\<hour[always 2 digits]>.txt
    • Rename the file(s) so that every file has the name of the server origin in it. Example: path c:\logs\sevices\check-in\2014-09-10\17-Leopoldstrasse.txt
    • Create a file that merges all files from all servers into on for each day. Name that file total.txt. Do this for the check-in and cashier service Example: c:\logs\sevices\check-in\2014-09-10\17-Leopold.txt 17:34:51, 2932 17:39:22, 1922 c:\logs\sevices\check-in\2014-09-10\19-Leopold.txt 19:22:51, 4132 19:31:22, 9122 c:\logs\sevices\check-in\2014-09-10\15-Sonnenstrasse.txt 15:51:51, 2222 15:99:22, 1222 c:\logs\sevices\check-in\2014-09-10\19-Sonnenstrasse.txt 19:12:51, 7332 19:19:22, 3522 Should result in a file name c:\logs\sevices\check-in\2014-09-10\total.txt that contains the following data 17:34:51, 2932 17:39:22, 1922 19:22:51, 4132 19:31:22, 9122 15:51:51, 2222 15:99:22, 1222 19:12:51, 7332 19:19:22, 3522
  • Report
[COLOR=#1F497D]Send an email and attach both “total” files for the check-in service and the cashier-service.
Use Powershell to write the script

Moderator's Comments:
Mod Comment no personal email please (email removed...)

Moderator's Comments:
Mod Comment Please use code tags next time for your code and data. Thanks

Last edited by vbe; 09-26-2014 at 05:44 AM..
# 2  
Old 09-26-2014
First: this is about "PowerShell", which is a Windows product and has nothing to do with Unix, therefore: wrong forum.

Second: this is homework, copied from some text book. I suggest you learn for yourself because we have already proved to have learned out part. I assume you are "olly72" from this thread from Microsofts Technet site, yes?

Thread closed, infractions follow.

bakunin
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. Linux

Syslog not logging successful logging while unlocking server's console

When unlocking a Linux server's console there's no event indicating successful logging Is there a way I can fix this ? I have the following in my rsyslog.conf auth.info /var/log/secure authpriv.info /var/log/secure (1 Reply)
Discussion started by: walterthered
1 Replies

2. UNIX for Advanced & Expert Users

Editing iptables rules with custom chain

Hello, I have iptables service running on my CentOS5 server. It has approx 50 rules right now. The problem I am facing now is as follows - I have to define a new chain in the filter table, say DOS_RULES & add all rules in this chain starting from index number 15 in the filter table. ... (1 Reply)
Discussion started by: BhushanPathak
1 Replies

3. Ubuntu

forward packet from input chain to output

Hi, I receive a packet at input chain of iptables in filter table. How can i forward that same packet exactly to the output chain of the iptables in filter table. I need this help desperately. Thanks. (0 Replies)
Discussion started by: arsipk
0 Replies

4. UNIX for Dummies Questions & Answers

Is it possible to extract a certificate chain?

Hi all! I wanted to look at the key length of a certificate chain we have. When I do the conventional export command using keytool I will only get the end user cert. keytool -export -alias aliasname -file filename.cer -keystore keystorename The above code will only give me the end user... (2 Replies)
Discussion started by: Keepcase
2 Replies

5. Shell Programming and Scripting

Find a sub chain in a file

Hello, I have a logfile from which i would to extract date and login information. (the goal is to find the inactive users). To extract the date, no problem. To extract the login, i'm stuck. I first extract lines which contains the logging-in information, i obtain different lines. Here... (2 Replies)
Discussion started by: Meldawa
2 Replies

6. Shell Programming and Scripting

How to chain some commands together

Hey, I am fiddling with a little script to kill a certain program if it freezes. Basically I want to do something like this: ps -A | grep firefox-bin | read -d ' ' pid kill $pid The problem lies when I pipe the output of grep into read. That part does not seem to work the way I want... (4 Replies)
Discussion started by: kermit
4 Replies
Login or Register to Ask a Question