File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 28
28
#
29
29
# spark_token : Bearer token for your Spark user/bot
30
30
# spark_room : Spark room name to which messages will be sent
31
+ # device_name : Device name from which the messages will be sent
31
32
#
32
33
# E.g.:
33
34
#
34
35
# event manager environment spark_token Bearer 1234abd...
35
36
# event manager environment spark_room Network Operators
37
+ # event manager environment device_name C3850
36
38
#
37
39
38
40
import eem
58
60
eem .action_syslog (
59
61
'Environment variable "spark_room" must be set' , priority = '3' )
60
62
sys .exit (1 )
63
+ if 'device_name' not in arr_envinfo :
64
+ eem .action_syslog (
65
+ 'Environment variable "device_name" must be set' , priority = '3' )
66
+ sys .exit (1 )
61
67
62
68
# Get a CLI handle
63
69
cli = eem .cli_open ()
98
104
# No differences found
99
105
sys .exit (0 )
100
106
101
- msg = 'Configuration differences between the running config and last backup:\n '
107
+ device_name = arr_envinfo ['device_name' ]
108
+ msg = '### Alert: Config changed on ' + device_name + '\n '
109
+ msg += 'Configuration differences between the running config and last backup:\n '
102
110
msg += '```{}```' .format ('\n ' .join (diff_lines [:- 1 ]))
103
111
104
112
headers = {
You can’t perform that action at this time.
0 commit comments