Skip to content

New general output functions for checks - #1483

Closed
sven-ruess wants to merge 13 commits into
monitoring-plugins:masterfrom
sven-ruess:sritd-printline
Closed

sven-ruess wants to merge 13 commits into
monitoring-plugins:masterfrom
sven-ruess:sritd-printline

Conversation

@sven-ruess

Copy link
Copy Markdown

Dear Monitoring Team,

I had a look at your checks and they are working great. I will introduce a new software, which the monitoring plugins will be one part of it. I have written some test cases for my own software and got some troubles. I have implemented my interpretation of the result to the general output specification: SERVICE STATUS: First line of output|First part of performance data|Second part of performance data
or
SERVICE STATUS: First line of output|First part of performance data|Second part of performance data
Third part of performance data|Fourth part of performance data ...

Some of the checks I have tested, does not take care about this behaviour. So I checked the code and tried to find the problem. I was successful and had a great look into the code from you.

As a general solution for this problem, I have done the following steps:

  • Introduced general output functions for this use case
  • print_singleline (int service_state, const char * msg, ...)
    Will print the output and returns to caller
  • print_singleline_return (int service_state, const char * msg, ...)
    Will print the output, returns the service_state as a return value and returns to caller
  • print_singleline_exit (int service_state, const char * msg, ...)
    Will print the output and exits program with service_state
  • Declaration and implementation is done in utils.h and utils.c

The first step is to get this new function accepted by you.

After that, my next steps will be the following:

  • Adapt sshutils.c and netutils.c to use this new functions
  • Adapt some tests, to take care about the new output results
  • Step by step change the checks to use this new functions and replace the usage* functions
  • Take care about the tests, that they will be successfully tested

Best regards
Sven

@sven-ruess

Copy link
Copy Markdown
Author

I do not know, why the tests for ping failed. I did not modify anything, which will be related to this issue. Perhaps you can trigger a restart for this test. I should be finished successful.

@sni

sni commented Apr 20, 2017

Copy link
Copy Markdown
Contributor

I triggered a recheck of the travis build.

@sven-ruess

Copy link
Copy Markdown
Author

Thank you. Now the tests are all successfully finished. Now you can have a look on the code. On the weekend I will adapt netutils and sslutils to use this new functions. For that I will create new branches from this current branch.

@sven-ruess

Copy link
Copy Markdown
Author

It looks like, that your tests have some timing issues. I only optimized my code a little bit and the tests fail again. Can you give me a short introduction, how I can get your tests running locally? I followed the steps of developer and user guide but most of the tests are failing. Do I have to setup a special environment or services?

@sven-ruess
sven-ruess force-pushed the sritd-printline branch 2 times, most recently from 6e3e234 to a01d24b Compare May 10, 2017 22:29
@RincewindsHat

Copy link
Copy Markdown
Member

this might be a little late, but it sounds interesting and I might take a look at that in the future.

@waja
waja requested a review from RincewindsHat February 3, 2023 15:42
@waja waja added this to the 2.4 milestone Feb 3, 2023
@waja waja modified the milestones: 2.4, 2.5 Jul 23, 2024
@RincewindsHat

Copy link
Copy Markdown
Member

Sorry for the lack of feedback on this. And implemented a different design with #2064 and want to go forward with.
Sorry again.

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.

4 participants