Skip to content

Commit

Permalink
Merge pull request #61 from ARGOeu/devel
Browse files Browse the repository at this point in the history
Release v0.3.6
  • Loading branch information
themiszamani authored Apr 2, 2020
2 parents 88f313c + 99258fd commit cb62d52
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
6 changes: 4 additions & 2 deletions argo-nagios-ams-publisher.spec
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
%endif

Name: argo-nagios-ams-publisher
Version: 0.3.5
Release: 2%{mydist}
Version: 0.3.6
Release: 1%{mydist}
Summary: Bridge from Nagios to the ARGO Messaging system

Group: Network/Monitoring
Expand Down Expand Up @@ -109,6 +109,8 @@ if ! /usr/bin/getent group nagiocmd &>/dev/null; then
fi

%changelog
* Tue Mar 31 2020 Daniel Vrcic <dvrcic@srce.hr> - 0.3.6-1%{?dist}
- ARGO-2224 Local delivery cache tool should pass non-ascii characters
* Tue Apr 23 2019 Daniel Vrcic <dvrcic@srce.hr> - 0.3.5-2%{?dist}
- regression fix to include site name in `site` field of notification
* Wed Apr 17 2019 Daniel Vrcic <dvrcic@srce.hr> - 0.3.5-1%{?dist}
Expand Down
8 changes: 4 additions & 4 deletions init/ams-publisher.service
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[Unit]
Description=AMS publisher
Description=AMS publisher
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/ams-publisherd -d start
ExecStop=/usr/bin/ams-publisherd -d stop
ExecStart=/usr/bin/ams-publisherd -d start
ExecStop=/usr/bin/ams-publisherd -d stop

[Install]
WantedBy=multiuser.target
WantedBy=multi-user.target
12 changes: 6 additions & 6 deletions pymod/alarmtoqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ def build_msg(args, *headers):

timestamp, service, hostname, testname, status, nagioshost = headers

msg.header.update({'execution_time': timestamp.encode('utf-8')})
msg.header.update({'service_flavour': service.encode('utf-8')})
msg.header.update({'node_name': hostname.encode('utf-8')})
msg.header.update({'test_name': testname.encode('utf-8')})
msg.header.update({'status': status.encode('utf-8')})
msg.header.update({'execution_time': timestamp})
msg.header.update({'service_flavour': service})
msg.header.update({'node_name': hostname})
msg.header.update({'test_name': testname})
msg.header.update({'status': status})

for bs in ['details', 'vo', 'site', 'roc', 'urlhistory', 'urlhelp']:
code = "msg.body += '%s: ' + args.%s.encode(\'utf-8\') + '\\n' if args.%s else ''" % (bs, bs, bs)
code = "msg.body += '%s: ' + args.%s + '\\n' if args.%s else ''" % (bs, bs, bs)
exec code

msg.text = True
Expand Down
14 changes: 7 additions & 7 deletions pymod/metrictoqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ def build_msg(args, *headers):

timestamp, service, hostname, metric, status, nagioshost = headers

msg.header.update({'timestamp': timestamp.encode('utf-8')})
msg.header.update({'service': service.encode('utf-8')})
msg.header.update({'hostname': hostname.encode('utf-8')})
msg.header.update({'metric': metric.encode('utf-8')})
msg.header.update({'status': status.encode('utf-8')})
msg.header.update({'monitoring_host': nagioshost.encode('utf-8')})
msg.header.update({'timestamp': timestamp})
msg.header.update({'service': service})
msg.header.update({'hostname': hostname})
msg.header.update({'metric': metric})
msg.header.update({'status': status})
msg.header.update({'monitoring_host': nagioshost})

for bs in ['summary', 'message', 'vofqan', 'voname', 'roc', 'actual_data', 'site']:
code = "msg.body += '%s: ' + args.%s.encode(\'utf-8\') + '\\n' if args.%s else ''" % (bs, bs, bs)
code = "msg.body += '%s: ' + args.%s + '\\n' if args.%s else ''" % (bs, bs, bs)
exec code

msg.text = True
Expand Down
2 changes: 1 addition & 1 deletion pymod/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _extract_body(self, body, fields, maps=None):
if maps and key in maps:
key = maps[key]

msg[key] = value.decode('utf-8', 'replace')
msg[key] = value

return msg

Expand Down

0 comments on commit cb62d52

Please sign in to comment.