Earlier quoted context omitted.
I considered doing it the way you described, but then you need to deploy software on every single one of your machines and make sure it's running, that it's not accidentally using up 99% of your CPU (I've had bad experiences with the monitoring agents for Splunk and Netdata misbehaving and slowing down the machines and causing problems), etc. Whereas with the "pull" approach I used in my tool, you don't need to deplo…
having a Netdata agent taking your machine's CPU to 99% shouldn't happen, not sure when was the list time you tried it but a lot of recent improvements have been done on the Netdata Agent also, with Netdata you can achieve the same architecture design using a Netdata Parent that could be your "control node" and to where you stream the metrics of the nodes you want to keep running with as less load as possible - you c…
Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
71–80 of 82 posts
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#72Fetching logs regularly sounds hard? Wouldn't you need to keep track of the position of all files, with heuristics around file rotations? And if something catastrophic happens, the most interesting data would be in that last block which couldn't be polled? Normally you'd avoid all that complexity by shipping logs the other way, sending from each machine. That way you can keep state locally should you need to. All uni…
rsync --append is your friend.
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#73Earlier quoted context omitted.
> I don't think globals are so awful for certain things. I prefer a more functional approach where you have simple composable standalone functions instead of classes. Obviously classes have a role, but I find they sometimes overly complicate things and make the logic harder to follow and debug. But "globals" and "composable standalone functions" are contradictory, if you're mutating global state your function is neit…
It's a single script. Globals are fine--they're even marked as such.
It's over 1200 lines of code, it's not like it's 100 lines of code and can fit on a single screen
> Globals are fine--they're even marked as such
I would argue that globals in this context are not fine from a code maintainability point of view.
By using globals here it's hard to know from a function call if it's going to mutate global state or not. If all the functions were methods of the same class instance, and other functions were just functions or part of some other class, then it gives you a clear grouping of calls which are related to mutating that state.
In general I would argue if you are ever in the situation of "I have more than two or three functions that are related to each other and they all need to mutate the same state so I use a mutable global" or "I pass around the mutable state via arguments" then make a class! It creates an obvious semantic grouping of callables.
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#74Oh, how I wish I had your scripts (and insights!) when I was analyzing Unix logs in 1986, looking for the footprints of an intruder...
Hope you're doing well!
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#75Fetching logs regularly sounds hard? Wouldn't you need to keep track of the position of all files, with heuristics around file rotations? And if something catastrophic happens, the most interesting data would be in that last block which couldn't be polled? Normally you'd avoid all that complexity by shipping logs the other way, sending from each machine. That way you can keep state locally should you need to. All uni…
> Wouldn't you need to keep track of the position of all files rsync --append is your friend.
It's also not as effective as streaming them to their intended target directly. Syslog can write a complementary local copy too should you wish to keep one.
Logs has been a thing since the past forty years. In order to reinvent it, it is good to be acquainted with the standard systems.
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#76Oh, how I wish I had your scripts (and insights!) when I was analyzing Unix logs in 1986, looking for the footprints of an intruder...
I'm kinda glad you didn't; it might have made the book I read as a kid (and again as an adult, and again with my offspring) less interesting somehow.
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#77Oh, how I wish I had your scripts (and insights!) when I was analyzing Unix logs in 1986, looking for the footprints of an intruder...
I was about to ask you to get around the campfire and tell the story again, but I see other commenters got ahead of me :). I'll be getting another Klein bottle soon for a gift, if you still do those :). Hope you're doing well!
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#78Oh, how I wish I had your scripts (and insights!) when I was analyzing Unix logs in 1986, looking for the footprints of an intruder...
Thanks for the comment! Going to check out your book now— I somehow hadn’t heard of it before despite it being right down my alley!
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#79Earlier quoted context omitted.
I'm kinda glad you didn't; it might have made the book I read as a kid (and again as an adult, and again with my offspring) less interesting somehow.
Uh, yes, h0p3 ... I didn't exactly start on that adventure thinking I'd write a book. Chasing after those hackers was orthogonal to my work in astronomy and the Keck telescope.
Re: Show HN: My Single-File Python Script I Used to Replace Splunk in My Startup
#80Earlier quoted context omitted.
Uh, yes, h0p3 ... I didn't exactly start on that adventure thinking I'd write a book. Chasing after those hackers was orthogonal to my work in astronomy and the Keck telescope.
Yes, sir. I appreciate that. I think you made that very clear in the book as well. I'll agree that having OP's tooling back then would likely have been quite useful to you and others. I'm often terrible with words. What I meant to say was: thank you for writing the book. Your story has been an important part of my family's lives for three generations (your work is also mentioned 3 times in my ℍ𝕪𝕡𝕖𝕣𝔱𝔢𝔵𝔱, and,…
My happy wishes to you and your family!
=Cliff