Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pmie: making pmie rule print consistent along with or without archive input #1800

Closed
wants to merge 1 commit into from

Conversation

orasagar
Copy link
Contributor

There is "print" written while running the pmie rule on archives but it is not there while running the same rule on the live system, this commit makes it consistent for both cases.

 input

There is "print" written while running the pmie rule on archives
but it is not there while running the same rule on the live system,
this commit makes it consistent for both cases.

Signed-off-by: sagar sagar <[email protected]>
Copy link
Member

@kmcdonell kmcdonell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@orasagar I understand sentiment here, but I don't agree with this change.

There is a long discussion over at #1779 on a very similar topic, and I've recently update the man page and docs to explain why "actions" (it is more than just print) are different for live vs archive rule firing.

Without a compelling use case (that I asked for but have not yet received over on #1779) I'd prefer to leave pmie as is.

@orasagar
Copy link
Contributor Author

@kmcdonell thanks, for the clarification

But I still feel like the action is a different thing but while just reading from the archive shouldn't be different from the live system.

@YoderExMachina
Copy link

I can understand why you would not want alerts popping up or syslog being updated when you are looking at archive data. Here's my use case:
I'm writing a health checker that will be run exclusively on archived data uploaded by various customers. The print at the beginning of the line is redundant in this circumstance.

It seems that this functionality exists to troubleshoot what would happen on a live system, but I'm dealing exclusively with archive data.

Thanks for your time and consideration.

@kmcdonell
Copy link
Member

Thanks @YoderExMachina.
Your use case matches the majority of my uses of pmie over the decades, namely in retrospective performance analysis.
Further the pmie-with-archives behaviour assists with rule development and tuning against historical data ... so pmie was conceived to be useful for much more than live system monitoring.

If I invoke circa-1970's Unix-thinking, I would suggest that

$ pmie .... | sed -e 's/^print //'

is a better solution that adding another flag to pmie to introduce a small variant in behaviour.

We cannot make the existing behaviour go away due to backwards compatilibility goals (who know what scripts an unconditional change in pmie behaviour might break), so we'd have to add some flag or option ... and if I was persuaded to do this it would be much more general that "don't emit print", e.g. -f|--format where is a combination of literal text and the metafield identifiers %a (action), %m (message), %d (ctime date as is), %D (ctime date with sub-second precision), so the current (and default) behaviour would be the same as -f '%a %d %m', and what you want would be -f '%d %m'.

Note also that the change as proposed in this PR is not acceptable because it removes the action type for all actions, not just print.

@YoderExMachina
Copy link

Okay I understand. Will stick with using sed.

@YoderExMachina
Copy link

@kmcdonell This is off topic and sorry if this isn't kosher, but is there some kind of community forum for PMIE? I'm new to the language and would like to read up on what others have done.

@kmcdonell
Copy link
Member

@YoderExMachina I am willing to consider the -f|--format extension if that would really help ... it solves your issue, but also it provides a framework to expose additional information in the future (different date formats, configuration file and line number for the rule that is firing, ...).

I'd need some indications from others that this is wothwhile, and then some cycles when this itch gets to the top of my TODO list.

As to the pmie "forum", there really isn't one per se. Best options are https://pcp.readthedocs.io/en/latest/QG/AutomatedReasoningBasics.html then the mailing list [email protected] or Slack (join at https://h7zo83mvt1.execute-api.us-west-2.amazonaws.com/Express/) or email directly to me (kenj at kenj.id.au).

@kmcdonell
Copy link
Member

kmcdonell commented Aug 31, 2023

@orasagar Kudos for being brave enough to jump into the pmie source, but the change you're suggestion does not really work. Are you OK if I close this PR and move the discussion to a new issue?

@orasagar
Copy link
Contributor Author

orasagar commented Sep 1, 2023

@kmcdonell Thanks ,Yeah sounds good to me, Although I have already opened an issue for this and we can continue our discussion there

@kmcdonell
Copy link
Member

We're moving the discussion to #1799 and expect a different approach to emerge compared to the changes outlined in this PR.

@kmcdonell kmcdonell closed this Sep 1, 2023
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.

3 participants