Skip to content

extend service type and CRITICAL state#7

Merged
martialblog merged 2 commits intoNETWAYS:masterfrom
chri2:chri2-patch
Jun 23, 2025
Merged

extend service type and CRITICAL state#7
martialblog merged 2 commits intoNETWAYS:masterfrom
chri2:chri2-patch

Conversation

@chri2
Copy link
Contributor

@chri2 chri2 commented Jun 13, 2025

#6

Returns the numerical status as text to icinga for service type 3 (PROCESS) of monit.

When in monit state initializing do not ignore the monitor, but return the monitor as CRITICAL to icinga.

#6

Returns the numerical status as text to icinga for service type 3 (PROCESS) of monit.

When in monit state _initializing_ do not ignore the monitor, but return the monitor as _CRITICAL_ to icinga.
@chri2
Copy link
Contributor Author

chri2 commented Jun 13, 2025

I opened an issue at monit asking for documentation for the xml content.

I'm running this version on three systems now and it solved the problems I found, but I might have misinterpreted the numerical values and probably there are ways to extend this to make the text output more helpful.

@martialblog
Copy link
Member

Good idea to open an issue, I'll keep an eye on it.

Thanks for the PR

Copy link
Member

@martialblog martialblog left a comment

Choose a reason for hiding this comment

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

Just some fixes the linter suggested

@martialblog
Copy link
Member

Let's wait and see If we get some details on the status page, if there is no feedback we can still merge it I think

@martialblog
Copy link
Member

martialblog commented Jun 13, 2025

Had a quick look at the monit source code: https://bitbucket.org/tildeslash/monit/src/master/src/monit.h

Still not sure what the monitor and status tells me exactly, but the possible values are probably:

typedef enum {
        Monitor_Not     = 0x0,
        Monitor_Yes     = 0x1,
        Monitor_Init    = 0x2,
        Monitor_Waiting = 0x4
} Monitor_State;

typedef enum {
        State_Succeeded  = 0x0,
        State_Failed     = 0x1,
        State_Changed    = 0x2,
        State_ChangedNot = 0x4,
        State_Init       = 0x8,
        State_None       = State_Init // Alias
} State_Type;

typedef enum {
        Service_Filesystem = 0,
        Service_Directory,
        Service_File,
        Service_Process,
        Service_Host,
        Service_System,
        Service_Fifo,
        Service_Program,
        Service_Net,
        Service_Last = Service_Net
} Service_Type;

@martialblog martialblog marked this pull request as ready for review June 23, 2025 11:58
@martialblog
Copy link
Member

I'll merge this and then we can extend it when we have further feedback on the status page

@martialblog martialblog merged commit 46543b3 into NETWAYS:master Jun 23, 2025
1 check passed
@chri2
Copy link
Contributor Author

chri2 commented Jul 1, 2025

Thanks!

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.

2 participants