Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
6b8ae122
Commit
6b8ae122
authored
May 18, 2012
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Post and report server modifications
parent
591dc493
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
18 deletions
+45
-18
src/exe/rt_post/src/rt_post.cpp
src/exe/rt_post/src/rt_post.cpp
+10
-6
src/exe/rt_report/src/rt_report.cpp
src/exe/rt_report/src/rt_report.cpp
+19
-4
src/wbl/pwrb/src/pwrb_c_postconfig.wb_load
src/wbl/pwrb/src/pwrb_c_postconfig.wb_load
+8
-8
src/wbl/pwrb/src/pwrb_c_reportconfig.wb_load
src/wbl/pwrb/src/pwrb_c_reportconfig.wb_load
+8
-0
No files found.
src/exe/rt_post/src/rt_post.cpp
View file @
6b8ae122
...
...
@@ -296,7 +296,7 @@ pwr_tStatus rt_post::mh_alarm_bc( mh_sMessage *MsgP)
post
->
format_email_text
(
MsgP
,
text
,
sizeof
(
text
));
post
->
format_cmd
(
cmd
,
post
->
conf
->
EmailCmd
,
address
,
text
);
if
(
post
->
conf
->
Log
)
if
(
post
->
conf
->
Options
&
pwr_mPostOptionsMask_
Log
)
errh_Info
(
"Email: %s"
,
cmd
);
system
(
cmd
);
...
...
@@ -313,7 +313,7 @@ pwr_tStatus rt_post::mh_alarm_bc( mh_sMessage *MsgP)
post
->
format_sms_text
(
MsgP
,
text
,
sizeof
(
text
));
post
->
format_cmd
(
cmd
,
post
->
conf
->
SMS_Cmd
,
sms
,
text
);
if
(
post
->
conf
->
Log
)
if
(
post
->
conf
->
Options
&
pwr_mPostOptionsMask_
Log
)
errh_Info
(
"SMS: %s"
,
cmd
);
system
(
cmd
);
...
...
@@ -332,7 +332,7 @@ pwr_tStatus rt_post::mh_cancel_bc( mh_sReturn *MsgP)
}
pwr_tStatus
rt_post
::
mh_info_bc
(
mh_sMessage
*
MsgP
)
{
return
1
;
return
mh_alarm_bc
(
MsgP
)
;
}
pwr_tStatus
rt_post
::
mh_clear_alarmlist_bc
(
pwr_tNodeIndex
nix
)
{
...
...
@@ -365,8 +365,12 @@ void rt_post::format_sms_text( mh_sMessage *MsgP, char *text, unsigned int size)
strcpy
(
prio
,
"?"
);
}
snprintf
(
text
,
size
,
"Proview %s Prio %s,
\n
%s,
\n
%s"
,
nodename
,
prio
,
event
->
Msg
.
EventText
,
event
->
Msg
.
EventName
);
if
(
conf
->
Options
&
pwr_mPostOptionsMask_SingleLineSMS
)
snprintf
(
text
,
size
,
"Proview %s Prio %s, %s, %s"
,
nodename
,
prio
,
event
->
Msg
.
EventText
,
event
->
Msg
.
EventName
);
else
snprintf
(
text
,
size
,
"Proview %s Prio %s,
\n
%s,
\n
%s"
,
nodename
,
prio
,
event
->
Msg
.
EventText
,
event
->
Msg
.
EventName
);
}
void
rt_post
::
format_email_text
(
mh_sMessage
*
MsgP
,
char
*
text
,
unsigned
int
size
)
...
...
@@ -508,7 +512,7 @@ int rt_post::email_check( mh_sEventId *id)
if
(
i
==
sent_email_endidx
)
break
;
if
(
memcmp
(
&
sent_email
[
i
],
id
,
sizeof
(
*
id
)))
if
(
memcmp
(
&
sent_email
[
i
],
id
,
sizeof
(
*
id
))
==
0
)
return
1
;
}
...
...
src/exe/rt_report/src/rt_report.cpp
View file @
6b8ae122
...
...
@@ -380,8 +380,8 @@ void rt_report::create_report( pwr_sClass_Report *o)
format_cmd
(
cmd
,
sizeof
(
cmd
),
conf_cmd
,
address
,
text
,
subject
,
cnvfile
,
0
);
// if ( conf->
Log)
//
errh_Info( "Email: %s", cmd);
if
(
conf
->
Options
&
pwr_mPostOptionsMask_
Log
)
errh_Info
(
"Email: %s"
,
cmd
);
system
(
cmd
);
conf
->
SentEmail
++
;
...
...
@@ -480,8 +480,16 @@ void rt_report::create_report( pwr_sClass_Report *o)
format_cmd
(
cmd
,
sizeof
(
cmd
),
conf_cmd
,
address
,
subject
,
text
,
cnvfile
,
0
);
// if ( conf->Log)
// errh_Info( "SMS: %s", cmd);
if
(
conf
->
Options
&
pwr_mPostOptionsMask_Log
)
errh_Info
(
"SMS: %s"
,
cmd
);
if
(
conf
->
Options
&
pwr_mPostOptionsMask_SingleLineSMS
)
{
for
(
char
*
s
=
cmd
;
*
s
;
s
++
)
{
// Replace LF with space
if
(
*
s
==
10
)
*
s
=
' '
;
}
}
system
(
cmd
);
conf
->
SentSMS
++
;
...
...
@@ -507,6 +515,9 @@ void rt_report::create_report( pwr_sClass_Report *o)
format_cmd
(
cmd
,
sizeof
(
cmd
),
conf_cmd
,
0
,
0
,
0
,
cnvfile
,
0
);
if
(
conf
->
Options
&
pwr_mPostOptionsMask_Log
)
errh_Info
(
"Print: %s"
,
cmd
);
system
(
cmd
);
sprintf
(
cmd
,
"rm %s"
,
tmpfile
);
...
...
@@ -563,6 +574,10 @@ void rt_report::create_report( pwr_sClass_Report *o)
system
(
cmd
);
}
sprintf
(
cmd
,
"rm %s"
,
tmpfile
);
if
(
conf
->
Options
&
pwr_mPostOptionsMask_Log
)
errh_Info
(
"File: %s"
,
cmd
);
system
(
cmd
);
}
}
...
...
src/wbl/pwrb/src/pwrb_c_postconfig.wb_load
View file @
6b8ae122
...
...
@@ -144,6 +144,14 @@ SObject pwrb:Class
EndBody
EndObject
!/**
! Options.
!*/
Object Options $Attribute 11
Body SysBody
Attr TypeRef = "pwrb:Type-PostOptionsMask"
EndBody
EndObject
!/**
! Server status.
!*/
Object Status $Attribute 5
...
...
@@ -182,14 +190,6 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Print posted commands to console log.
!*/
Object Log $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject
Object Template PostConfig
Body RtBody
...
...
src/wbl/pwrb/src/pwrb_c_reportconfig.wb_load
View file @
6b8ae122
...
...
@@ -168,6 +168,14 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Options.
!*/
Object Options $Attribute 10
Body SysBody
Attr TypeRef = "pwrb:Type-PostOptionsMask"
EndBody
EndObject
EndObject
Object Template ReportConfig
Body RtBody
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment