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

The problem with Russian symbols in $SERVICEOUTPUT$ for Business Rules Notifications. #2002

Open
apovyshev opened this issue Dec 1, 2020 · 1 comment

Comments

@apovyshev
Copy link

Hello,

Currently, I am experiencing the problem with receiving $SERVICEOUTPUT$ information from Business Rules Notifications in Russian language.
At the same time I have no problems with the $SERVICEOUTPUT$ information form host's service.
Let me show you the examples.

The 'notify-service-by-email' command is the following:

define command {
    command_name                    notify-business-service-by-email
    command_line                   /usr/bin/printf "%b" "Notification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\n\nService URL: $SERVICENOTESURL$\nState: $SERVICESTATE$\nPriority: $SERVICEBUSINESSIMPACT$\nResponsible Team: $_SERVICERESPONSIBLE$\n\nDate/Time: $DATE$ $TIME$\n\n\nAdditional Info: $SERVICEOUTPUT$" \
                                  | /usr/bin/mail \
                                    -s "** $NOTIFICATIONTYPE$ alert - $SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$ $CONTACTADDRESS1$ $CONTACTADDRESS2$
}

The output for this command is:

Additional Info : (187) < 2020-11-29T05:03:11.391548038Z [08:03:11 WG.HeadHunterPresentationService.Core.Vacancies.SyncVacancies ERR] Add vacancy {"Id": 2346073, "JobName": "UI Developer (10009609)", "Name": "Верстальщик игровых интерфейсов", "Status": "Open", "Description": "<p>Компания расширяет команду разработки и приглашает <strong>UI Developer</strong>.&nbsp;</p>

As you can see, there are Russian symbols in $SERVICEOUTPUT$.

The command for Business Rule is the following:

define command {
    command_name                    notify-business-service-by-email-shinkenps-test
    command_line                   /usr/bin/printf "%b" 'Notification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nState: $SERVICESTATE$\nPriority: $SERVICEBUSINESSIMPACT$\nResponsible Team: $_SERVICERESPONSIBLE$\n\nDate/Time: $DATE$ $TIME$\n\nAdditional Info : $SERVICEOUTPUT$\n' \
                                  | /usr/bin/mail \
                                    -s '** $NOTIFICATIONTYPE$ alert - $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **' $CONTACTEMAIL$
}

But the output is broken:

Additional Info : CRITICAL - [ s-server-01/HeadHunterPresentationService-Prod-Error Log is CRITICAL - (187) < 2020-11-29T05:03:11.391548038Z [08:03:11 WG.HeadHunterPresentationService.Core.Vacancies.SyncVacancies ERR] Add vacancy {"Id": 2346073, "JobName": "UI Developer (10009609)", "Name": "п▓п╣я─я│я┌п╟п╩я▄я┴п╦п╨ п╦пЁя─п╬п╡я▀я┘ п╦п╫я┌п╣я─я└п╣п╧я│п╬п╡", "Status": "Open", "Description": "<p>п п╬п╪п©п╟п╫п╦я▐ я─п╟я│я┬п╦я─я▐п╣я┌ п╨п╬п╪п╟п╫п╢я┐ я─п╟п╥я─п╟п╠п╬я┌п╨п╦ п╦ п©я─п╦пЁп╩п╟я┬п╟п╣я┌ <strong>UI Developer</strong>.&nbsp;</p> - <p>;Б─■ п╪п╬п╠п╦п╩я▄п╫я▀п╧&nbsp;free-to-play&nbsp;MMO-я█п╨я┬п╣п╫, п©п╬я│п╡я▐я┴я▒п╫п╫я▀п╧ я┌п╟п╫п╨п╬п╡я▀п╪ я│я─п╟п╤п╣п╫п╦я▐п╪ я│п╣я─п╣п╢п╦п╫я▀ п╔п╔ п╡п╣п╨п╟. п÷я─п╬п╢я┐п╪п╟п╫п╫п╟я▐ п╦пЁя─п╬п╡п╟я▐ п╪п╣я┘п╟п╫п╦п╨п╟ п╦ я─п╣п╟п╩п╦я│я┌п╦я┤п╫п╟я▐ я└п╦п╥п╦я┤п╣я│п╨п╟я▐ п╪п╬п╢п╣п╩я▄ п╡ я│п╬я┤п╣я┌п╟п╫п╦п╦ я│ я┐п╢п╬п╠п╫я▀п╪ я┐п©я─п╟п╡п╩п╣п╫п╦п╣п╪ п╦ я│п╬п╡я─п╣п╪п╣п╫п╫п╬п╧ пЁя─п  ╟я└п╦п╨п╬п╧ п©я─п╣п╢п╩п╟пЁп╟я▌я┌ я┐п╫п╦п╨п╟п╩я▄п╫я▀п╧ я└п╬я─п╪п╟я┌ п╨п╬п╪п╟п╫п╢п╫я▀я┘ п╬п╫п╩п╟п╧п╫-п╠п╟я┌п╟п╩п╦п╧ п╫п╟ п╪п╬п╠п╦п╩я▄п╫ ]

The BR if the following:

define service {
    use                             business-service, low-technical-service
    service_description             HeadHunterPresentationService s-dockrabbit-01 Error 1
    host_name                       services-eu
    check_command                   bp_rule!(s-dockrabbit-01,HeadHunterPresentationService-Prod-Error Log)
    contacts                  test
    _RESPONSIBLE                    IT
	business_rule_output_template               $STATUS$ - [ $( $FULLNAME$ is $STATUS$ - $SERVICEOUTPUT$ - $LONGSERVICEOUTPUT$ )$ ]	
}

business-service

define service{
    use                                         generic-service
    name                                        business-service
    notification_interval                       0
    notification_period                         24x7
    max_check_attempts                          1
    business_rule_smart_notifications           1
    business_rule_downtime_as_ack               1
    business_rule_output_template               $STATUS$ - [ $( $FULLNAME$ is $STATUS$  )$ ]

    register                                    0
}

low-technical-service

define service {
    name                                        low-technical-service
    use                                         business-service
    register                                    0
    business_impact                             3
    business_rule_smart_notifications           1
    business_rule_downtime_as_ack               1
    servicegroups                               low-technical-services
    _TYPE                                       Technical
    _IMPACT                                     Low
}

Can anyone help with such an issue?
Thank you!

@geektophe
Copy link
Collaborator

I'm not sure business rules output has been thought to correctly output unicode symbols, or it has not been tested in such a case.

I'll see if I can improve this.

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

No branches or pull requests

2 participants