erikng / Cacher

A python script for extracting macOS Caching Server data
Apache License 2.0
134 stars 40 forks source link

Show stats since boot in Alert. #18

Closed ahusking closed 8 years ago

ahusking commented 8 years ago

I've added 2 variables in the variables section to store uptime and the last log entry for data returned.

then display that data at the top of the Alert that goes into the logs.

Not sure if it's the best way to do it or if anyone else would be interested but people were here.

erikng commented 8 years ago

This is clever and might be a way to fix the bad calculations after a reboot.

We may have a need for caching servers soon and that will give me reason to start rewriting/fixing Cacher.

Thanks for the PRs. You're kind of inspiring me to pick this back up and work on it again.

Sent from my iPhone

On Sep 15, 2016, at 4:57 PM, Andrew Husking notifications@github.com<mailto:notifications@github.com> wrote:

I've added 2 variables in the variables section to store uptime and the last log entry for data returned.

then display that data at the top of the Alert that goes into the logs.

Not sure if it's the best way to do it or if anyone else would be interested but people were here.


You can view, comment on, or merge this pull request online at:

https://github.com/erikng/Cacher/pull/18

Commit Summary

File Changes

Patch Links:

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/erikng/Cacher/pull/18, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFa_GBPt7AwDAe0OK_3Mkd4gFbeGj8Uuks5qqdtmgaJpZM4J-eiw.

ahusking commented 8 years ago

Glad to help. More than happy to assist in the future as well!

Andrew Husking Network Engineer (M) 0404782069

(E) andrew@husking.id.au

http://husking.id.au

On Fri, Sep 16, 2016 at 11:03 AM, Erik Gomez notifications@github.com wrote:

This is clever and might be a way to fix the bad calculations after a reboot.

We may have a need for caching servers soon and that will give me reason to start rewriting/fixing Cacher.

Thanks for the PRs. You're kind of inspiring me to pick this back up and work on it again.

Sent from my iPhone

On Sep 15, 2016, at 4:57 PM, Andrew Husking <notifications@github.com< mailto:notifications@github.com>> wrote:

I've added 2 variables in the variables section to store uptime and the last log entry for data returned.

then display that data at the top of the Alert that goes into the logs.

Not sure if it's the best way to do it or if anyone else would be interested but people were here.


You can view, comment on, or merge this pull request online at:

https://github.com/erikng/Cacher/pull/18

Commit Summary

  • Show stats since boot in Alert.

File Changes

  • M Cacherhttps://github.com/erikng/Cacher/pull/18/files#diff-0 (7)

Patch Links:

You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ erikng/Cacher/pull/18, or mute the threadhttps://github.com/ notifications/unsubscribe-auth/AFa_GBPt7AwDAe0OK_ 3Mkd4gFbeGj8Uuks5qqdtmgaJpZM4J-eiw.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/erikng/Cacher/pull/18#issuecomment-247495119, or mute the thread https://github.com/notifications/unsubscribe-auth/AATo9onFMwfl3rdQ31KAF4KXHSyEQz0Eks5qqerlgaJpZM4J-eiw .

rayzurbock commented 8 years ago

Was it meant for this to only be displayed on the screen instead of shown in the AlertLog file to be emailed?

I've added the code to my instance, but was just curious if this was intended to not be included in the email?

To add to my instance (which included merged pull request # 19) I inserted the following at line 157:

echo $datasinceboot >> "${tmplocation}"/AlertInfo.txt
echo  " " >> "${tmplocation}"/AlertInfo.txt
ahusking commented 8 years ago

Whoops, I missed that bit, sorry

On 17 Sep. 2016, at 12:31 am, Brian Lowrance notifications@github.com wrote:

Was it meant for this to only be displayed on the screen instead of shown in the AlertLog file to be emailed?

I've added the code to my instance, but was just curious if this was intended to not be included in the email?

To add to my instance I inserted the following at line 157:

echo $datasinceboot >> "${tmplocation}"/AlertInfo.txt echo " " >> "${tmplocation}"/AlertInfo.txt

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/erikng/Cacher/pull/18#issuecomment-247615600, or mute the thread https://github.com/notifications/unsubscribe-auth/AATo9q7aPGOq9_U54eDPBF-hvnSJyeq-ks5qqqg8gaJpZM4J-eiw .

erikng commented 8 years ago

Good catch. I thought about this as well but was on mobile at the time. Can you send another PR Andrew?

Sent from my iPhone

On Sep 16, 2016, at 2:14 PM, Andrew Husking notifications@github.com<mailto:notifications@github.com> wrote:

Whoops, I missed that bit, sorry

On 17 Sep. 2016, at 12:31 am, Brian Lowrance notifications@github.com<mailto:notifications@github.com> wrote:

Was it meant for this to only be displayed on the screen instead of shown in the AlertLog file to be emailed?

I've added the code to my instance, but was just curious if this was intended to not be included in the email?

To add to my instance I inserted the following at line 157:

echo $datasinceboot >> "${tmplocation}"/AlertInfo.txt echo " " >> "${tmplocation}"/AlertInfo.txt

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/erikng/Cacher/pull/18#issuecomment-247615600, or mute the thread https://github.com/notifications/unsubscribe-auth/AATo9q7aPGOq9_U54eDPBF-hvnSJyeq-ks5qqqg8gaJpZM4J-eiw .

You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/erikng/Cacher/pull/18#issuecomment-247710503, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFa_GIIcJUjyhFLwaHQhqGYZUkBG3YYNks5qqwZ5gaJpZM4J-eiw.

calum-github commented 8 years ago

In the interests of reducing line count and duplication

instead of:

echo "Cacher has retrieved the following stats for $yesterday:" echo "Cacher has retrieved the following stats for $yesterday:" >> "${tmplocation}"/AlertInfo.txt

You can do: echo "Cacher has retrieved the following stats for $yesterday:" 2>&1 | tee -a "${implication}"/AlertInfo.txt ` which will display it to stdout/stderr and also pipe it to the alertinfo.txt file :)

erikng commented 8 years ago

Nice! I expect a PR with fixes for all entries. :)

Hope you're doing well man.

Sent from my iPad

On Sep 21, 2016, at 12:50 AM, Calum notifications@github.com<mailto:notifications@github.com> wrote:

In the interests of reducing line count and duplication

instead of:

echo "Cacher has retrieved the following stats for $yesterday:" echo "Cacher has retrieved the following stats for $yesterday:" >> "${tmplocation}"/AlertInfo.txt

You can do: echo "Cacher has retrieved the following stats for $yesterday:" 2>&1 | tee -a "${implication}"/AlertInfo.txt ` which will display it to stdout/stderr and also pipe it to the alertinfo.txt file :)

You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/erikng/Cacher/pull/18#issuecomment-248537475, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFa_GGKppCHGf4Co9cF1rvwSPRZXrC9Vks5qsOHBgaJpZM4J-eiw.