File common/bin2json.c changed (mode: 100644) (index e3f805f..409cce1) |
... |
... |
int nd_bin2json(struct json_object **pj, |
59 |
59 |
ret = -1; |
ret = -1; |
60 |
60 |
break; |
break; |
61 |
61 |
} |
} |
62 |
|
json_object_object_add(j, "ts", json_object_new_uint64(s.ts)); |
|
|
62 |
|
json_object_object_add(j, "ts", json_object_new_int64(s.ts)); |
63 |
63 |
json_object_object_add(j, "uptime", json_object_new_int(s.si.uptime)); |
json_object_object_add(j, "uptime", json_object_new_int(s.si.uptime)); |
64 |
64 |
json_object_object_add(j, "load1", json_object_new_int(s.si.loads[0])); |
json_object_object_add(j, "load1", json_object_new_int(s.si.loads[0])); |
65 |
|
json_object_object_add(j, "tram", json_object_new_uint64(s.si.totalram * s.si.mem_unit)); |
|
66 |
|
json_object_object_add(j, "fram", json_object_new_uint64(s.si.freeram * s.si.mem_unit)); |
|
67 |
|
json_object_object_add(j, "fswap", json_object_new_uint64(s.si.freeswap * s.si.mem_unit)); |
|
68 |
|
json_object_object_add(j, "procs", json_object_new_uint64(s.si.procs)); |
|
69 |
|
json_object_object_add(j, "totalhigh", json_object_new_uint64(s.si.totalhigh * s.si.mem_unit)); |
|
70 |
|
json_object_object_add(j, "freehigh", json_object_new_uint64(s.si.freehigh * s.si.mem_unit)); |
|
71 |
|
json_object_object_add(j, "sharedram", json_object_new_uint64(s.si.sharedram * s.si.mem_unit)); |
|
72 |
|
json_object_object_add(j, "bufferram", json_object_new_uint64(s.si.bufferram * s.si.mem_unit)); |
|
|
65 |
|
json_object_object_add(j, "tram", json_object_new_int64(s.si.totalram * s.si.mem_unit)); |
|
66 |
|
json_object_object_add(j, "fram", json_object_new_int64(s.si.freeram * s.si.mem_unit)); |
|
67 |
|
json_object_object_add(j, "fswap", json_object_new_int64(s.si.freeswap * s.si.mem_unit)); |
|
68 |
|
json_object_object_add(j, "procs", json_object_new_int64(s.si.procs)); |
|
69 |
|
json_object_object_add(j, "totalhigh", json_object_new_int64(s.si.totalhigh * s.si.mem_unit)); |
|
70 |
|
json_object_object_add(j, "freehigh", json_object_new_int64(s.si.freehigh * s.si.mem_unit)); |
|
71 |
|
json_object_object_add(j, "sharedram", json_object_new_int64(s.si.sharedram * s.si.mem_unit)); |
|
72 |
|
json_object_object_add(j, "bufferram", json_object_new_int64(s.si.bufferram * s.si.mem_unit)); |
73 |
73 |
} break; |
} break; |
74 |
74 |
|
|
75 |
75 |
default: |
default: |
File webd/certs.c changed (mode: 100644) (index 910776b..6209b32) |
... |
... |
static int certs_load_one(struct Conn *C, const char *dir, |
45 |
45 |
|
|
46 |
46 |
json_object_object_add(j, "subj", json_object_new_string(cert.subj)); |
json_object_object_add(j, "subj", json_object_new_string(cert.subj)); |
47 |
47 |
json_object_object_add(j, "issuer", json_object_new_string(cert.issuer)); |
json_object_object_add(j, "issuer", json_object_new_string(cert.issuer)); |
48 |
|
json_object_object_add(j, "not_before", json_object_new_uint64(cert.not_before)); |
|
49 |
|
json_object_object_add(j, "not_after", json_object_new_uint64(cert.not_after)); |
|
|
48 |
|
json_object_object_add(j, "not_before", json_object_new_int64(cert.not_before)); |
|
49 |
|
json_object_object_add(j, "not_after", json_object_new_int64(cert.not_after)); |
50 |
50 |
json_object_object_add(j, "path", json_object_new_string(cert.path)); |
json_object_object_add(j, "path", json_object_new_string(cert.path)); |
51 |
51 |
json_object_object_add(j, "serial", json_object_new_string(cert.serial)); |
json_object_object_add(j, "serial", json_object_new_string(cert.serial)); |
52 |
52 |
char xtype[2] = { cert.type, 0 }; |
char xtype[2] = { cert.type, 0 }; |
53 |
53 |
json_object_object_add(j, "type", json_object_new_string(xtype)); |
json_object_object_add(j, "type", json_object_new_string(xtype)); |
54 |
54 |
json_object_object_add(j, "sig_alg", json_object_new_string(cert.sig_alg)); |
json_object_object_add(j, "sig_alg", json_object_new_string(cert.sig_alg)); |
55 |
55 |
json_object_object_add(j, "pk_alg", json_object_new_string(cert.pk_alg)); |
json_object_object_add(j, "pk_alg", json_object_new_string(cert.pk_alg)); |
56 |
|
json_object_object_add(j, "pk_bits", json_object_new_uint64(cert.pk_bits)); |
|
|
56 |
|
json_object_object_add(j, "pk_bits", json_object_new_int(cert.pk_bits)); |
57 |
57 |
sj = json_object_to_json_string(j); |
sj = json_object_to_json_string(j); |
58 |
58 |
|
|
59 |
59 |
char code[8192]; |
char code[8192]; |
File webd/machines.c changed (mode: 100644) (index eb6ad3f..27a1ed8) |
... |
... |
static int machines_load_one(struct Conn *C, char *dir, |
49 |
49 |
|
|
50 |
50 |
char *id = basename(dir); |
char *id = basename(dir); |
51 |
51 |
json_object_object_add(j, "id", json_object_new_string(id)); |
json_object_object_add(j, "id", json_object_new_string(id)); |
52 |
|
json_object_object_add(j, "first_seen", json_object_new_uint64(first_seen / 1000)); |
|
53 |
|
json_object_object_add(j, "last_seen", json_object_new_uint64(last_seen / 1000)); |
|
|
52 |
|
json_object_object_add(j, "first_seen", json_object_new_int64(first_seen / 1000)); |
|
53 |
|
json_object_object_add(j, "last_seen", json_object_new_int64(last_seen / 1000)); |
54 |
54 |
sj = json_object_to_json_string(j); |
sj = json_object_to_json_string(j); |
55 |
55 |
|
|
56 |
56 |
char code[8192]; |
char code[8192]; |