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

No spaces in validateServiceName allowed #53

Open
Decstasy opened this issue Jan 19, 2021 · 2 comments
Open

No spaces in validateServiceName allowed #53

Decstasy opened this issue Jan 19, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Decstasy
Copy link

Hello,

I was searching for a while, after I realized, that signalilo cannot handle alertnames with spaces correctly.
You can repreduce my problem if you fire an alert with an Alertname like "This is a test".

The regex https://github.com/vshn/signalilo/blob/master/webhook/icinga.go#L28 prevents that anything with a space will be sent to icinga2.
Is there a reason, that there is no string replace to convert spaces to underscores or just properly encode the spaces to the GET method for the Icinga2 API?

I would love to see this fixed, since many people are using spaces in their names.

Thanks and best regards,
Dennis

@Decstasy Decstasy changed the title No spaces in validateServiceName No spaces in validateServiceName allowed Jan 19, 2021
@Decstasy
Copy link
Author

One more thing: If the validation failed in the first place, signalilo is still trying to create the service and gets an 500 error from the Icinga2 API, that there is no service name given.

status": "Object could not be created."}​​​​​]}​​​​​{​​​​​"level":"error","msg":"Error in checkOrCreateService for : create /services/signalilo! : 500 Internal Server Error - Object could not be created. Error: Object name must not be empty.

@simu simu added the bug Something isn't working label Jan 19, 2021
@simu
Copy link
Member

simu commented Jan 19, 2021

Hi Dennis,

Thanks for the report. To address your initial question: we've simply not encountered the case of having spaces in the Alertname until now, so we never considered this when generating the internal service name for Icinga2.

Looking at the service name computation and validation and subsequent Icinga2 API calls, I see a whole bunch of issues. I'll try to find some time to clean up the implementation soon.

Best regards,
-- Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants