-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
3443 lines (3122 loc) · 142 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* z/VM Performance Monitor Daemon
* Copyright (C) 2008, 2009 Przemyslaw Kupisz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <syslog.h>
#include <signal.h>
#include <unistd.h> //STDXX_FILENO
//#include </usr/include/asm/div64.h>
// old path #include </usr/include/asm/types.h>
#include </usr/include/asm-generic/types.h>
#include </usr/include/mysql/mysql.h>
typedef __uint64_t __eu64;
#include "recstruct.h"
#include "e2a.h"
#define HDRL 1
typedef enum {TRUE = 1, FALSE = 0} bool;
//Daemon init
static void daemon_init(const char *name)
{
pid_t pid;
int i;
if (pid = fork() != 0) exit(0);
setsid();
signal(SIGHUP, SIG_IGN);
if ((pid = fork()) != 0) exit(0);
chdir("/");
umask(0);
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
}
//end daemon init
// /dev/monreader access exepctions
int if_error(int errsv)
{
//switch (errsv)
if (errsv == EFAULT) {
syslog(LOG_ERR, "EFAULT Read /dev/monreader failed. Copy to user failed. Missing data. \n");
return 1;
}
if (errsv == EIO) {
syslog(LOG_ERR, "EIO Reply failed. Missing data. No IUCV connection to the z/VM *MONITOR could be established. \n");
return 1;
}
if (errsv == EOVERFLOW) {
syslog(LOG_ERR, "EOVERFLOW Message limit reach. \n");
return 2;
}
if (errsv == EBUSY) {
syslog(LOG_WARNING, "EBUSY Open /dev/monreader failed. Device has already been opened by another user or you don't have permmision to read /dev/monreader. \n");
return 2;
}
return 0;
}
// end exepctions
// TIME FUNCTIONS BEGIN
__eu64 tod2utc(__eu64 time)
{
time = (__eu64) time - (__eu64) 0x7d91048bca000000ULL;
time = time >> 12;
//time = do_div(time, 1000000);
time = time / 1000000;
return time;
};
// TIME FUNCTIONS END
struct mce
{
__u8 rec_type;
__u8 domains;
__u16 ibm;
__u32 rec_start;
__u32 rec_end;
};
struct header
{
__u16 rec_length;
__u16 zeros;
__u8 domain_id;
__u8 ibm;
__u16 rec_id;
__eu64 build_time; //TOD
__u32 ibm2;
};
int main(int argc, char *argv[])
{
/*
if (argc != 2) {
printf("type size of buffer as an arg\n");
exit(1);
}
*/
/* NEW feature when deamonize will be enabled, this code will be before demonize process code
*/
if ((argc != 5) || (argv[1] == "help") || (argv[1] == "h") || (argv[1] == "--h") || (argv[1] == "-help")) {
printf(
"Syntax: zpmd [segment size] [host ip] [DB User name] [DB Name] \n"
"After that You will be asked to input password for database user \n"
"\n"
"Notice, opinion, propositions of improvements send on p.kupisz@gmail.com\n"
"This software is part of Author's BSc Thesis.\n"
"New releases can be found on sourceforge.net.\n"
"\n"
"z/VM Performance Monitor Daemon version 0.8, \n"
"Copyright (C) 2008,2009 Przemyslaw Kupisz \n"
"z/VM Performance Monitor Daemon comes with ABSOLUTELY NO WARRANTY \n"
"This is free software, and you are welcome \n"
"to redistribute it under certain conditions \n"
"See the GNU General Public License for more details. \n"
);
exit(1);
}
//Connecting to syslog
//openlog(argv[0], LOG_PID | LOG_PERROR, LOG_DAEMON);
openlog(argv[0], LOG_CONS, LOG_DAEMON);
unsigned int bytes_read = atoi(argv[1]);
char hostip[256];
strcpy(hostip, argv[2]);
char dbuser[256];
strcpy(dbuser, argv[3]);
char dbname[256];
strcpy(dbname, argv[4]);
char passwd[256];
printf("Enter user password to database\n");
scanf("%s",passwd);
//Daemonize process
daemon_init(argv[0]);
//Create buffer
int errsv;
int monfd;
bool b = 0;
__u32 index;
__u8 *bufor;
__u8 *bzero;
//__u8 *bmax;
//TIME VARIABLES
__u32 utc; //hdr time TOD --> UTC
//tmp variables for all structures who need conversion like cpu time, tod...
__u32 ttmp1;
__u32 ttmp2;
__u32 ttmp3;
__u32 ttmp4;
__u32 ttmp5;
__u32 ttmp6;
__u32 ttmp7;
__u32 ttmp8;
//
bufor = (__u8*) calloc(bytes_read, sizeof(__u8));
if (bufor == NULL) {
syslog(LOG_ERR, "No free space in memory for buffer.");
exit(1);
}
//MYSQL SPACE BEGIN
//MYSQL DEF BEGIN
MYSQL mysql;
char qbuf[4096];
//MYSQLDEF END
//MYSQL CONNECTION BEGIN
if (!mysql_init(&mysql)) {
syslog(LOG_ALERT, "Cannot initialize MySQL Database Connection.");
exit(1);
}
if (!mysql_real_connect(&mysql, hostip, dbuser, passwd, dbname, 0, NULL, 0)) {
syslog(LOG_ERR, "%d: %s \n", mysql_errno(&mysql), mysql_error(&mysql));
exit(1);
}
//MYSQL CONNECTION END
/////////////////////////////////////////////////////////////////////////////////////////////////
#include "create_tables.h"
/////////////////////////////////////////////////////////////////////////////////////////////////
//MYSQL SPACE END
bzero = bufor;
//Open /dev/monreader
monfd = open("/dev/monreader", O_RDONLY, 0);
errsv = errno;
if (if_error(errsv) == 2) exit(1);
//Read /dev/monreader > bufor
__u8 load;
int ilosc_wczytanych;
__u32 i=0;
load = 0;
//load = NULL;
while (1)
{
ilosc_wczytanych = read(monfd, &load, sizeof(__u8));
errsv = errno;
if (errsv == EAGAIN) {
continue;
}
if (if_error(errsv) == 2) exit(1); //EOVERFLOW
if (if_error(errsv) == 1) {
bufor=bzero;
memset(bufor, '0', bytes_read);
i=0;
while (ilosc_wczytanych)
{
ilosc_wczytanych = read(monfd, &load, sizeof(__u8));
}
load = 0;
continue;
}
if (i > bytes_read) {
syslog(LOG_ERR, "(i > bytes_read)");
exit(1);
}
*bufor = load;
++bufor;
++i;
//PROCESSING RECORDS --START
if (ilosc_wczytanych != 0 ) continue;
bufor = bzero;
struct mce *mptr;
mptr = (struct mce *) bufor;
index = 12; //temporary solution
for (i=0;i<index;i++) ++bufor;
i=0; //i=0 for next loop (while)
struct header *hptr;
hptr = (struct header *) bufor;
//debug begin =======>
//syslog(LOG_DEBUG, "D=%uR=%u", hptr->domain_id, hptr->rec_id);
//debug end <=======
//clear time variables
utc=0;
ttmp1=0;
ttmp2=0;
ttmp3=0;
ttmp4=0;
ttmp5=0;
ttmp6=0;
ttmp7=0;
ttmp8=0;
//UTC Time for header
utc = (__eu64) tod2utc( (__eu64) hptr->build_time);
//Making pointers to structures
//*System Domain*//
struct d0r1 *d0r1p;
d0r1p = (struct d0r1 *) bufor;
struct d0r2 *d0r2p;
d0r2p = (struct d0r2 *) bufor;
struct d0r3 *d0r3p;
d0r3p = (struct d0r3 *) bufor;
struct d0r4 *d0r4p;
d0r4p = (struct d0r4 *) bufor;
struct d0r5 *d0r5p;
d0r5p = (struct d0r5 *) bufor;
struct d0r6 *d0r6p;
d0r6p = (struct d0r6 *) bufor;
struct d0r7 *d0r7p;
d0r7p = (struct d0r7 *) bufor;
struct d0r11 *d0r11p;
d0r11p = (struct d0r11 *) bufor;
struct d0r12 *d0r12p;
d0r12p = (struct d0r12 *) bufor;
struct d0r13 *d0r13p;
d0r13p = (struct d0r13 *) bufor;
struct d0r14 *d0r14p;
d0r14p = (struct d0r14 *) bufor;
struct d0r15 *d0r15p;
d0r15p = (struct d0r15 *) bufor;
struct d0r19 *d0r19p;
d0r19p = (struct d0r19 *) bufor; //not tested
struct d0r21 *d0r21p;
d0r21p = (struct d0r21 *) bufor;
struct d0r22 *d0r22p;
d0r22p = (struct d0r22 *) bufor;
//*Monitor Domain*//
struct d1r1 *d1r1p;
d1r1p = (struct d1r1 *) bufor;
struct d1r3 *d1r3p;
d1r3p = (struct d1r3 *) bufor;
struct d1r4 *d1r4p;
d1r4p = (struct d1r4 *) bufor;
struct d1r5 *d1r5p;
d1r5p = (struct d1r5 *) bufor;
struct d1r9 *d1r9p;
d1r9p = (struct d1r9 *) bufor;
struct d1r10 *d1r10p;
d1r10p = (struct d1r10 *) bufor;
struct d1r17 *d1r17p;
d1r17p = (struct d1r17 *) bufor;
struct d1r18 *d1r18p;
d1r18p = (struct d1r18 *) bufor;
struct d1r19 *d1r19p;
d1r19p = (struct d1r19 *) bufor;
struct d1r20 *d1r20p;
d1r20p = (struct d1r20 *) bufor;
//*Sheduler Domain*//
struct d2r1 *d2r1p;
d2r1p = (struct d2r1 *) bufor;
struct d2r2 *d2r2p;
d2r2p = (struct d2r2 *) bufor;
struct d2r3 *d2r3p;
d2r3p = (struct d2r3 *) bufor;
/*
struct d2r4 *d2r4p;
d2r4p = (struct d2r4 *) bufor;
struct d2r5 *d2r5p;
d2r5p = (struct d2r5 *) bufor;
struct d2r6 *d2r6p;
d2r6p = (struct d2r6 *) bufor;
*/
struct d2r9 *d2r9p;
d2r9p = (struct d2r9 *) bufor;
struct d2r10 *d2r10p;
d2r10p = (struct d2r10 *) bufor;
struct d2r11 *d2r11p;
d2r11p = (struct d2r11 *) bufor;
struct d2r12 *d2r12p;
d2r12p = (struct d2r12 *) bufor;
//*Storage Domain*//
struct d3r1 *d3r1p;
d3r1p = (struct d3r1 *) bufor;
struct d3r2 *d3r2p;
d3r2p = (struct d3r2 *) bufor;
struct d3r3 *d3r3p;
d3r3p = (struct d3r3 *) bufor;
struct d3r4 *d3r4p;
d3r4p = (struct d3r4 *) bufor;
struct d3r5 *d3r5p;
d3r5p = (struct d3r5 *) bufor;
struct d3r6 *d3r6p;
d3r6p = (struct d3r6 *) bufor;
struct d3r7 *d3r7p;
d3r7p = (struct d3r7 *) bufor;
struct d3r8 *d3r8p;
d3r8p = (struct d3r8 *) bufor;
struct d3r9 *d3r9p;
d3r9p = (struct d3r9 *) bufor;
struct d3r10 *d3r10p;
d3r10p = (struct d3r10 *) bufor;
struct d3r11 *d3r11p;
d3r11p = (struct d3r11 *) bufor;
struct d3r12 *d3r12p;
d3r12p = (struct d3r12 *) bufor;
struct d3r13 *d3r13p;
d3r13p = (struct d3r13 *) bufor;
struct d3r14 *d3r14p;
d3r14p = (struct d3r14 *) bufor;
struct d3r15 *d3r15p;
d3r15p = (struct d3r15 *) bufor;
struct d3r16 *d3r16p;
d3r16p = (struct d3r16 *) bufor;
struct d3r17 *d3r17p;
d3r17p = (struct d3r17 *) bufor;
struct d3r18 *d3r18p;
d3r18p = (struct d3r18 *) bufor;
struct d3r19 *d3r19p;
d3r19p = (struct d3r19 *) bufor;
struct d3r20 *d3r20p;
d3r20p = (struct d3r20 *) bufor;
//*User Domain*//
struct d4r5 *d4r5p;
d4r5p = (struct d4r5 *) bufor;
struct d4r6 *d4r6p;
d4r6p = (struct d4r6 *) bufor;
struct d4r7 *d4r7p;
d4r7p = (struct d4r7 *) bufor;
struct d4r9 *d4r9p;
d4r9p = (struct d4r9 *) bufor;
struct d4r10 *d4r10p;
d4r10p = (struct d4r10 *) bufor;
//*Processor Domain*//
struct d5r1 *d5r1p;
d5r1p = (struct d5r1 *) bufor;
struct d5r2 *d5r2p;
d5r2p = (struct d5r2 *) bufor;
struct d5r3 *d5r3p;
d5r3p = (struct d5r3 *) bufor;
struct d5r6 *d5r6p;
d5r6p = (struct d5r6 *) bufor;
struct d5r7 *d5r7p;
d5r7p = (struct d5r7 *) bufor;
struct d5r8 *d5r8p;
d5r8p = (struct d5r8 *) bufor;
struct d5r9 *d5r9p;
d5r9p = (struct d5r9 *) bufor;
struct d5r11 *d5r11p;
d5r11p = (struct d5r11 *) bufor;
struct d5r12 *d5r12p;
d5r12p = (struct d5r12 *) bufor;
//*I/O Domain*//
struct d6r1 *d6r1p;
d6r1p = (struct d6r1 *) bufor;
struct d6r2 *d6r2p;
d6r2p = (struct d6r2 *) bufor;
struct d6r5 *d6r5p;
d6r5p = (struct d6r5 *) bufor;
struct d6r6 *d6r6p;
d6r6p = (struct d6r6 *) bufor;
struct d6r7 *d6r7p;
d6r7p = (struct d6r7 *) bufor;
struct d6r8 *d6r8p;
d6r8p = (struct d6r8 *) bufor;
struct d6r12 *d6r12p;
d6r12p = (struct d6r12 *) bufor;
struct d6r13 *d6r13p;
d6r13p = (struct d6r13 *) bufor;
struct d6r14 *d6r14p;
d6r14p = (struct d6r14 *) bufor;
struct d6r15 *d6r15p;
d6r15p = (struct d6r15 *) bufor;
struct d6r17 *d6r17p;
d6r17p = (struct d6r17 *) bufor;
struct d6r22 *d6r22p;
d6r22p = (struct d6r22 *) bufor;
struct d6r23 *d6r23p;
d6r23p = (struct d6r23 *) bufor;
struct d6r24 *d6r24p;
d6r24p = (struct d6r24 *) bufor;
struct d6r25 *d6r25p;
d6r25p = (struct d6r25 *) bufor;
struct d6r26 *d6r26p;
d6r26p = (struct d6r26 *) bufor;
struct d6r27 *d6r27p;
d6r27p = (struct d6r27 *) bufor;
struct d6r28 *d6r28p;
d6r28p = (struct d6r28 *) bufor;
struct d6r29 *d6r29p;
d6r29p = (struct d6r29 *) bufor;
struct d6r30 *d6r30p;
d6r30p = (struct d6r30 *) bufor;
//*Seek Domain*//
struct d7r1 *d7r1p;
d7r1p = (struct d7r1 *) bufor;
//*Virtual Networking Domain*//
struct d8r1 *d8r1p;
d8r1p = (struct d8r1 *) bufor;
struct d8r2 *d8r2p;
d8r2p = (struct d8r2 *) bufor;
struct d8r3 *d8r3p;
d8r3p = (struct d8r3 *) bufor;
//DYNAMIC STRUCT FOR TEXT STRING
struct d1r10_txt
{
__u8 filler[32];
__u8 mtrscm_calcmd[d1r10p->mtrscm_calbyct];
};
struct d1r10_txt *d1r10_txtp;
d1r10_txtp = (struct d1r10_txt *) bufor;
//*CHOOSING DOMAIN & RECORD ID*//
if (hptr->domain_id == 0)
{
switch (hptr->rec_id)
{
case 1 :
//SQL QUERY R-1
sprintf(qbuf, "INSERT INTO d0r1 VALUES ('',FROM_UNIXTIME(%u),'%hu','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r1p->sytsyp_pfxcpuad,
d0r1p->sytsyp_plsabnct,
d0r1p->sytsyp_plsdiagt,
d0r1p->sytsyp_plsprvis,
d0r1p->sytsyp_plsextnx,
d0r1p->sytsyp_plsextnc,
d0r1p->sytsyp_plsmchct,
d0r1p->sytsyp_plsctss,
d0r1p->sytsyp_plsctrs,
d0r1p->sytsyp_plsctcs,
d0r1p->sytsyp_plscths,
d0r1p->sytsyp_plsctsi,
d0r1p->sytsyp_plsctui,
d0r1p->sytsyp_plspiopr,
d0r1p->sytsyp_plspiopw,
d0r1p->sytsyp_plspiosr,
d0r1p->sytsyp_plspiosw,
d0r1p->sytsyp_plsdguct,
d0r1p->sytsyp_plsxitct,
d0r1p->sytsyp_plspagps,
d0r1p->sytsyp_plsstkpe,
d0r1p->sytsyp_plstmrce,
d0r1p->sytsyp_plsprvsc,
d0r1p->sytsyp_pfxcputy);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 2 :
break;
case 3 :
//SQL QUERY R-3
sprintf(qbuf, "INSERT INTO d0r3 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%s','%u','%s','%u','%u','%u','%u','%u','%u','%u','%u','%u','%s','%u','%u','%u','%s','%u','%s','%s','%s','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r3p->sytrsg_sysrsvpg,
d0r3p->sytrsg_rsacplok,
d0r3p->sytrsg_rsanonpg,
d0r3p->sytrsg_rsapgabl,
d0r3p->sytrsg_rsaavail,
d0r3p->sytrsg_rsafrqwt,
d0r3p->sytrsg_rsaxtend,
d0r3p->sytrsg_rsasavfr,
d0r3p->sytrsg_calflag1,
d0r3p->sytrsg_hcpstpmb,
d0r3p->sytrsg_sys98xa,
d0r3p->sytrsg_tcmmidsz,
d0r3p->sytrsg_tcmmain,
d0r3p->sytrsg_tcmmnmin,
d0r3p->sytrsg_tcmmnmax,
d0r3p->sytrsg_tcmmndl,
d0r3p->sytrsg_tcmstlmn,
d0r3p->sytrsg_sysscmav,
d0r3p->sytrsg_tcmmnblw,
d0r3p->sytrsg_tcmmnabv,
d0r3p->sytrsg_rsa2gdct,
d0r3p->sytrsg_sysscgct,
d0r3p->sytrsg_rsalgfrm,
d0r3p->sytrsg_rsacplkg,
d0r3p->sytrsg_rsa2gavl,
d0r3p->sytrsg_rsa2gav1,
d0r3p->sytrsg_rsa2gav2,
d0r3p->sytrsg_rsafsb2g,
d0r3p->sytrsg_rsafsa2g,
d0r3p->sytrsg_rsafsyub,
d0r3p->sytrsg_rsafsyua,
d0r3p->sytrsg_rsasxcpl,
d0r3p->sytrsg_rsasxcla,
d0r3p->sytrsg_rsarfrst,
d0r3p->sytrsg_rsarfrsg,
d0r3p->sytrsg_rsasxbct,
d0r3p->sytrsg_rsasxact,
d0r3p->sytrsg_rsaafrdb,
d0r3p->sytrsg_rsaafrdw,
d0r3p->sytrsg_rsaafrib,
d0r3p->sytrsg_rsaafriu,
d0r3p->sytrsg_rsacalct,
d0r3p->sytrsg_rsasng2g,
d0r3p->sytrsg_rsasngav,
d0r3p->sytrsg_rsaltdb1,
d0r3p->sytrsg_rsaltda1,
d0r3p->sytrsg_rsaltdd1,
d0r3p->sytrsg_rsaltdc1,
d0r3p->sytrsg_rsaltdb2,
d0r3p->sytrsg_rsaltda2,
d0r3p->sytrsg_rsaltdd2,
d0r3p->sytrsg_rsaltdc2,
d0r3p->sytrsg_rsaltdbe,
d0r3p->sytrsg_rsaltdae,
d0r3p->sytrsg_rsaltdde,
d0r3p->sytrsg_rsaltdce,
d0r3p->sytrsg_rsadrmb1,
d0r3p->sytrsg_rsadrma1,
d0r3p->sytrsg_rsadrmd1,
d0r3p->sytrsg_rsadrmc1,
d0r3p->sytrsg_rsadrmb2,
d0r3p->sytrsg_rsadrma2,
d0r3p->sytrsg_rsadrmd2,
d0r3p->sytrsg_rsadrmc2,
d0r3p->sytrsg_rsadrmbe,
d0r3p->sytrsg_rsadrmae,
d0r3p->sytrsg_rsadrmde,
d0r3p->sytrsg_rsadrmce,
d0r3p->sytrsg_rsaelgb1,
d0r3p->sytrsg_rsaelga1,
d0r3p->sytrsg_rsaelgd1,
d0r3p->sytrsg_rsaelgc1,
d0r3p->sytrsg_rsaelgb2,
d0r3p->sytrsg_rsaelga2,
d0r3p->sytrsg_rsaelgd2,
d0r3p->sytrsg_rsaelgc2,
d0r3p->sytrsg_rsaelgbe,
d0r3p->sytrsg_rsaelgae,
d0r3p->sytrsg_rsaelgde,
d0r3p->sytrsg_rsaelgce,
d0r3p->sytrsg_rsadspb1,
d0r3p->sytrsg_rsadspa1,
d0r3p->sytrsg_rsadspd1,
d0r3p->sytrsg_rsadspc1,
d0r3p->sytrsg_rsadspb2,
d0r3p->sytrsg_rsadspa2,
d0r3p->sytrsg_rsadspd2,
d0r3p->sytrsg_rsadspc2,
d0r3p->sytrsg_rsadspbe,
d0r3p->sytrsg_rsadspae,
d0r3p->sytrsg_rsadspde,
d0r3p->sytrsg_rsadspce,
d0r3p->sytrsg_rsashrb1,
d0r3p->sytrsg_rsashra1,
d0r3p->sytrsg_rsashrd1,
d0r3p->sytrsg_rsashrc1,
d0r3p->sytrsg_rsashrb2,
d0r3p->sytrsg_rsashra2,
d0r3p->sytrsg_rsashrd2,
d0r3p->sytrsg_rsashrc2,
d0r3p->sytrsg_rsashrbe,
d0r3p->sytrsg_rsashrae,
d0r3p->sytrsg_rsashrde,
d0r3p->sytrsg_rsashrce,
d0r3p->sytrsg_rsaresac,
d0r3p->sytrsg_rsaresbc);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 4 :
//SQL QUERY R-4
sprintf(qbuf, "INSERT INTO d0r4 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r4p->sytrsp_pfxcpuad,
d0r4p->sytrsp_plsstlfr,
d0r4p->sytrsp_plsprqdf,
d0r4p->sytrsp_plsshrrd,
d0r4p->sytrsp_plsalemp,
d0r4p->sytrsp_plsnocmp,
d0r4p->sytrsp_plsmvb2g,
d0r4p->sytrsp_plsalemg,
d0r4p->sytrsp_plsgclem,
d0r4p->sytrsp_plsmvabv,
d0r4p->sytrsp_pfxcputy,
d0r4p->sytrsp_plsalecl,
d0r4p->sytrsp_plsalecg);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 5 :
//SQL QUERY R-5
sprintf(qbuf, "INSERT INTO d0r5 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r5p->sytxsp_pfxcpuad,
d0r5p->sytxsp_pfxpgin,
d0r5p->sytxsp_plspgin,
d0r5p->sytxsp_plspgout,
d0r5p->sytxsp_plspgxrd,
d0r5p->sytxsp_plspgxwt,
d0r5p->sytxsp_plspgmrx,
d0r5p->sytxsp_plspgmrd,
d0r5p->sytxsp_pfxcputy);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 6 :
//SQL QUERY R-6
sprintf(qbuf, "INSERT INTO d0r6 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r6p->sytasg_cal90ful,
d0r6p->sytasg_cal91ful,
d0r6p->sytasg_calslta1,
d0r6p->sytasg_calslti1,
d0r6p->sytasg_calslta2,
d0r6p->sytasg_calslti2,
d0r6p->sytasg_syssfcrt,
d0r6p->sytasg_syssfpur,
d0r6p->sytasg_caltotm1,
d0r6p->sytasg_calavgm1,
d0r6p->sytasg_caltotm2,
d0r6p->sytasg_calavgm2,
d0r6p->sytasg_caldmpav,
d0r6p->sytasg_caldmpiu);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 7 :
//SQL QUERY R-7
sprintf(qbuf, "INSERT INTO d0r7 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r7p->sytshs_systanss,
d0r7p->sytshs_systadcs,
d0r7p->sytshs_rsashare,
d0r7p->sytshs_calnumsa,
d0r7p->sytshs_rsactshr,
d0r7p->sytshs_vmdsforo,
d0r7p->sytshs_vmdsfore,
d0r7p->sytshs_qdgsyslm,
d0r7p->sytshs_qdgusrlm,
d0r7p->sytshs_qdgsysca,
d0r7p->sytshs_qdglkcnt,
d0r7p->sytshs_qdgdisks);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 8 :
break;
case 9 :
break;
case 10 :
break;
case 11 :
//SQL QUERY R-11
sprintf(qbuf, "INSERT INTO d0r11 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r11p->sytcom_pfxcpuad,
d0r11p->sytcom_plsisevm,
d0r11p->sytcom_plsisema,
d0r11p->sytcom_plsisem,
d0r11p->sytcom_plsisera,
d0r11p->sytcom_plsisebl,
d0r11p->sytcom_plsisemo,
d0r11p->sytcom_plsistma,
d0r11p->sytcom_plsistvm,
d0r11p->sytcom_plsistm,
d0r11p->sytcom_plsistra,
d0r11p->sytcom_plsistbl,
d0r11p->sytcom_plsistmo,
d0r11p->sytcom_plsisuvm,
d0r11p->sytcom_plsisuma,
d0r11p->sytcom_plsisum,
d0r11p->sytcom_plsisura,
d0r11p->sytcom_plsisubl,
d0r11p->sytcom_plsisumo,
d0r11p->sytcom_plsvsevm,
d0r11p->sytcom_plsvstvm,
d0r11p->sytcom_plsvsuvm,
d0r11p->sytcom_plsisecc,
d0r11p->sytcom_plsistcc,
d0r11p->sytcom_plsisucc,
d0r11p->sytcom_plsisesi,
d0r11p->sytcom_plsistsi,
d0r11p->sytcom_plsisusi,
d0r11p->sytcom_plsisesp,
d0r11p->sytcom_plsistsp,
d0r11p->sytcom_plsisusp,
d0r11p->sytcom_plsisesy,
d0r11p->sytcom_plsistsy,
d0r11p->sytcom_plsisusy,
d0r11p->sytcom_plsiseac,
d0r11p->sytcom_plsistac,
d0r11p->sytcom_plsisuac,
d0r11p->sytcom_plsiselo,
d0r11p->sytcom_plsistlo,
d0r11p->sytcom_plsisulo,
d0r11p->sytcom_plsisecr,
d0r11p->sytcom_plsistcr,
d0r11p->sytcom_plsisucr,
d0r11p->sytcom_plsiseid,
d0r11p->sytcom_plsistid,
d0r11p->sytcom_plsisuid,
d0r11p->sytcom_plsisecf,
d0r11p->sytcom_plsistcf,
d0r11p->sytcom_plsisucf,
d0r11p->sytcom_plsiucvt,
d0r11p->sytcom_pfxcputy,
d0r11p->sytcom_plsisevs,
d0r11p->sytcom_plsistvs,
d0r11p->sytcom_plsisuvs,
d0r11p->sytcom_plsiseas,
d0r11p->sytcom_plsistas,
d0r11p->sytcom_plsisuas,
d0r11p->sytcom_plsisesc,
d0r11p->sytcom_plsistsc,
d0r11p->sytcom_plsisusc,
d0r11p->sytcom_plsiseve,
d0r11p->sytcom_plsistve,
d0r11p->sytcom_plsisuve);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 12 :
//SQL QUERY R-12
sprintf(qbuf, "INSERT INTO d0r12 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%i','%i','%i','%i','%i','%i','%i','%i','%i','%u','%i','%u','%u','%u','%u','%u','%u','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i','%i')",
utc,
d0r12p->sytuwt_caltidl,
d0r12p->sytuwt_caltsvm,
d0r12p->sytuwt_caliowt,
d0r12p->sytuwt_calwtpag,
d0r12p->sytuwt_calcfwt,
d0r12p->sytuwt_calsimwt,
d0r12p->sytuwt_calcpuwt,
d0r12p->sytuwt_calcpurn,
d0r12p->sytuwt_calothr,
d0r12p->sytuwt_calqdisp,
d0r12p->sytuwt_calelsvm,
d0r12p->sytuwt_srmcelig,
d0r12p->sytuwt_srmdsvmw,
d0r12p->sytuwt_calioact,
d0r12p->sytuwt_calllist,
d0r12p->sytuwt_calllcp,
d0r12p->sytuwt_calllzap,
d0r12p->sytuwt_calllifl,
d0r12p->sytuwt_calllzip,
d0r12p->sytuwt_calcfcp,
d0r12p->sytuwt_calcfzap,
d0r12p->sytuwt_calcfifl,
d0r12p->sytuwt_calcfzip,
d0r12p->sytuwt_calswcp,
d0r12p->sytuwt_calswzap,
d0r12p->sytuwt_calswifl,
d0r12p->sytuwt_calswzip,
d0r12p->sytuwt_calcwcp,
d0r12p->sytuwt_calcwzap,
d0r12p->sytuwt_calcwifl,
d0r12p->sytuwt_calcwzip,
d0r12p->sytuwt_calcrcp,
d0r12p->sytuwt_calcrzap,
d0r12p->sytuwt_calcrifl,
d0r12p->sytuwt_calcrzip);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 13 :
//SQL QUERY R-13
sprintf(qbuf, "INSERT INTO d0r13 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r13p->sytscp_pfxcpuad,
d0r13p->sytscp_plseqkad,
d0r13p->sytscp_plsefrc1,
d0r13p->sytscp_plsefrc2,
d0r13p->sytscp_plsefrc3,
d0r13p->sytscp_plsdspcn,
d0r13p->sytscp_pfxcputy);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 14 :
//SQL QUERY R-14
sprintf(qbuf, "INSERT INTO d0r14 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%s','%s','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%u')",
utc,
d0r14p->sytxsg_xstxbget,
d0r14p->sytxsg_xstxbrel,
d0r14p->sytxsg_xstusrsh,
d0r14p->sytxsg_xstctxav,
d0r14p->sytxsg_xstcppar,
d0r14p->sytxsg_hcpmdcpy,
d0r14p->sytxsg_hcpmdcpn,
d0r14p->sytxsg_hcpmdcpr,
d0r14p->sytxsg_hcpmdcpw,
d0r14p->sytxsg_hcpmdcac,
d0r14p->sytxsg_hcpmdcne,
d0r14p->sytxsg_hcpmdcex,
d0r14p->sytxsg_hcpmdcli,
d0r14p->sytxsg_calmdcau,
d0r14p->sytxsg_hcpmdcis,
d0r14p->sytxsg_hcpmdcqc,
d0r14p->sytxsg_hcpmdcxg,
d0r14p->sytxsg_hcpmdcxr,
d0r14p->sytxsg_hcpmdctr,
d0r14p->sytxsg_hcpmdcia,
d0r14p->sytxsg_hcpmdcib,
d0r14p->sytxsg_hcpmdcit,
d0r14p->sytxsg_tcmxidsz,
d0r14p->sytxsg_tcmxsmin,
d0r14p->sytxsg_tcmstlxs,
d0r14p->sytxsg_xstavgag,
d0r14p->sytxsg_hcpstpxb,
d0r14p->sytxsg_tcmfshvm,
d0r14p->sytxsg_tcmrdct,
d0r14p->sytxsg_tcmpin4k);
if (mysql_query(&mysql, qbuf))
{
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 15 :
//EBCDIC 2 ASCII
e2a(d0r15p->sytcug_lparname,8);
//SQL QUERY R-15
sprintf(qbuf, "INSERT INTO d0r15 VALUES ('',FROM_UNIXTIME(%u),'%u','%u','%u','%u','%u','%u','%u','%u','%u','%u','%s','%u','%u','%u')",
utc,
d0r15p->sytcug_lcutnpar,
d0r15p->sytcug_lcutflag,
d0r15p->sytcug_lcutslce,
d0r15p->sytcug_lcutpcct,
d0r15p->sytcug_lpnumber,
d0r15p->sytcug_cpuchar,
d0r15p->sytcug_cpucount,
d0r15p->sytcug_cpucfgct,
d0r15p->sytcug_cpustnby,
d0r15p->sytcug_cpuresvd,
d0r15p->sytcug_lparname,
d0r15p->sytcug_lparcaf,
d0r15p->sytcug_cpudedct,
d0r15p->sytcug_cpushard);
if (mysql_query(&mysql, qbuf)) {
syslog(LOG_ERR, "%s \n", mysql_error(&mysql));
}
break;
case 16 :
break;
case 17 :
break;
case 18 :
break;
case 19 :