Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Synchronet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
141
Issues
141
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
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
Main
Synchronet
Compare Revisions
53c4d3faa12a13b8242b9954fb9e68a9e6f27aff...2645dee022a7fd64f393489a7ab55469e760786c
Source
2645dee022a7fd64f393489a7ab55469e760786c
Select Git revision
...
Target
53c4d3faa12a13b8242b9954fb9e68a9e6f27aff
Select Git revision
Compare
Commits (1)
Display node client information (IP address, protocol, duration of connection)
· 2645dee0
Rob Swindell
authored
Dec 13, 2020
when selecting a node (data comes from node#/client.ini). For Nelgin.
2645dee0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
13 deletions
+34
-13
src/sbbs3/umonitor/umonitor.c
src/sbbs3/umonitor/umonitor.c
+34
-13
No files found.
src/sbbs3/umonitor/umonitor.c
View file @
2645dee0
...
...
@@ -66,7 +66,7 @@
uifcapi_t
uifc
;
/* User Interface (UIFC) Library API */
const
char
*
YesStr
=
"Yes"
;
const
char
*
NoStr
=
"No"
;
char
*
app_title
=
"Synchronet UNIX Monitor v"
VERSION
" "
PLATFORM_DESC
;
char
app_title
[
128
]
;
int
ciolib_mode
=
CIOLIB_MODE_AUTO
;
int
lprintf
(
char
*
fmt
,
...)
...
...
@@ -323,10 +323,12 @@ int drawstats(scfg_t *cfg, int nodenum, node_t *node, int *curp, int *barp) {
stats_t
nstats
;
char
statbuf
[
6
*
78
];
/* Buffer to hold the stats for passing to uifc.showbuf() */
char
str
[
4
][
4
][
12
];
char
heading
[
128
];
char
usrname
[
128
];
char
tmp
[
128
];
ulong
free
;
uint
i
,
l
,
m
;
time_t
t
;
time_t
t
,
now
;
int
shownode
=
1
;
if
(
getnodedat
(
cfg
,
nodenum
,
node
,
FALSE
,
NULL
))
{
...
...
@@ -338,16 +340,25 @@ int drawstats(scfg_t *cfg, int nodenum, node_t *node, int *curp, int *barp) {
username
(
cfg
,
node
->
useron
,
usrname
);
getstats
(
cfg
,
0
,
&
sstats
);
t
=
time
(
NULL
);
strftime
(
str
[
0
][
0
],
12
,
"%b %e"
,
localtime
(
&
t
));
free
=
getfreediskspace
(
cfg
->
data_dir
,
1024
);
if
(
free
<
1000
)
{
free
=
getfreediskspace
(
cfg
->
data_dir
,
0
);
getsizestr
(
str
[
0
][
1
],
free
,
TRUE
);
}
else
getsizestr
(
str
[
0
][
1
],
free
,
FALSE
);
now
=
time
(
NULL
);
if
(
shownode
)
{
static
client_t
client
;
time_t
hangup
=
now
;
getnodeclient
(
cfg
,
nodenum
,
&
client
,
&
hangup
);
t
=
client
.
time
?
client
.
time
:
now
;
if
(
node
->
status
!=
NODE_WFC
&&
node
->
status
!=
NODE_OFFLINE
)
safe_snprintf
(
heading
,
sizeof
(
heading
),
"`Node #`%-3d %s `%s`: %s"
,
nodenum
,
sectostr
(
now
-
t
,
tmp
)
,
client
.
protocol
,
client
.
addr
);
else
safe_snprintf
(
heading
,
sizeof
(
heading
),
"`Node #`%-3d %s `%s`: %s `on` %.12s"
,
nodenum
,
sectostr
(
hangup
-
t
,
tmp
)
,
client
.
protocol
,
client
.
addr
,
ctime
(
&
hangup
)
+
4
);
snprintf
(
str
[
1
][
0
],
12
,
"%s/%s"
,
getnumstr
(
str
[
3
][
2
],
nstats
.
ltoday
),
getnumstr
(
str
[
3
][
3
],
sstats
.
ltoday
));
getnumstr
(
str
[
1
][
1
],
sstats
.
logons
);
snprintf
(
str
[
1
][
2
],
12
,
"%s/%s"
,
getnumstr
(
str
[
3
][
2
],
nstats
.
ttoday
),
getnumstr
(
str
[
3
][
3
],
sstats
.
ttoday
));
...
...
@@ -367,6 +378,14 @@ int drawstats(scfg_t *cfg, int nodenum, node_t *node, int *curp, int *barp) {
getnumstr
(
str
[
3
][
3
],
sstats
.
dls
);
}
else
{
free
=
getfreediskspace
(
cfg
->
data_dir
,
1024
);
if
(
free
<
1000
)
{
free
=
getfreediskspace
(
cfg
->
data_dir
,
0
);
getsizestr
(
str
[
0
][
0
],
free
,
TRUE
);
}
else
getsizestr
(
str
[
0
][
0
],
free
,
FALSE
);
sprintf
(
heading
,
"`Space`: %s `in` %s"
,
str
[
0
][
0
],
cfg
->
data_dir
);
snprintf
(
str
[
1
][
0
],
12
,
"%s"
,
getnumstr
(
str
[
3
][
3
],
sstats
.
ltoday
));
getnumstr
(
str
[
1
][
1
],
sstats
.
logons
);
snprintf
(
str
[
1
][
2
],
12
,
"%s"
,
getnumstr
(
str
[
3
][
3
],
sstats
.
ttoday
));
...
...
@@ -385,11 +404,11 @@ int drawstats(scfg_t *cfg, int nodenum, node_t *node, int *curp, int *barp) {
getsizestr
(
str
[
3
][
2
],
sstats
.
dlb
,
TRUE
);
getnumstr
(
str
[
3
][
3
],
sstats
.
dls
);
}
snprintf
(
statbuf
,
sizeof
(
statbuf
),
"
`Node #`: %-3d %6s `Space`:
%s"
snprintf
(
statbuf
,
sizeof
(
statbuf
),
"%s"
"
\n
`Logons`: %-11s `Total`: %-11s `Timeon`: %-11s `Total`: %-11s"
"
\n
`Emails`: %-11s `Posts`: %-11s `Fbacks`: %-11s `Users`: %-11s"
"
\n
`Uloads`: %-11s `Files`: %-11s `Dloads`: %-11s `Files`: %-11s"
,
nodenum
,
str
[
0
][
0
],
str
[
0
][
1
]
,
heading
,
str
[
1
][
0
],
str
[
1
][
1
],
str
[
1
][
2
],
str
[
1
][
3
],
str
[
2
][
0
],
str
[
2
][
1
],
str
[
2
][
2
],
str
[
2
][
3
],
str
[
3
][
0
],
str
[
3
][
1
],
str
[
3
][
2
],
str
[
3
][
3
]);
...
...
@@ -823,6 +842,8 @@ int main(int argc, char** argv) {
time_t
last_semfile_check
=
time
(
NULL
);
int
idle_sleep
=
100
;
SAFEPRINTF2
(
app_title
,
"Synchronet UNIX Monitor v%s%c"
,
VERSION
,
REVISION
);
/******************/
/* Ini file stuff */
/******************/
...
...