Subversion Repositories computer_asset_manager_v1

Rev

Rev 21 | Rev 29 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21 Rev 22
Line 37... Line 37...
37
my $count = qq/select 
37
my $count = qq/select 
38
                  count(*) 'Count'
38
                  count(*) 'Count'
39
               from sysinfo_report
39
               from sysinfo_report
40
               where sysinfo_report.added_date > date_sub( now(), interval 1 day)/;
40
               where sysinfo_report.added_date > date_sub( now(), interval 1 day)/;
41
               
41
               
-
 
42
#my $missing = qq/select
-
 
43
#                  device_id ID,
-
 
44
#                  device.name name
-
 
45
#               from (
-
 
46
#                  select 
-
 
47
#                     distinct( device_id ) 
-
 
48
#                  from 
-
 
49
#                     sysinfo_report
-
 
50
#                  where 
-
 
51
#                     datediff( current_date(),added_date) < 5
-
 
52
#                  ) last_five
-
 
53
#                  join device using ( device_id )
-
 
54
#               where 
-
 
55
#                  device.device_id not in (
-
 
56
#                     select 
-
 
57
#                        distinct( device_id ) 
-
 
58
#                     from 
-
 
59
#                        sysinfo_report 
-
 
60
#                     where 
-
 
61
#                        datediff( current_date(),added_date) < 1)/;
-
 
62
                        
42
my $missing = qq/select
63
my $missing = qq/select
43
                  device_id ID,
64
                  last_five.device_id ID,
44
                  device.name name
65
                  device.name name
45
               from (
66
               from (
46
                  select 
67
                  select 
47
                     distinct( device_id ) 
68
                     distinct( device_id ) 
48
                  from 
69
                  from 
49
                     sysinfo_report
70
                     sysinfo_report
50
                  where 
71
                  where 
51
                     datediff( current_date(),added_date) < 5
72
                     datediff( current_date(),added_date) < 5
52
                  ) last_five
73
                  ) last_five
-
 
74
                  left join
-
 
75
                  (
-
 
76
                  select 
-
 
77
                     distinct( device_id ) 
-
 
78
                  from 
-
 
79
                     sysinfo_report
-
 
80
                  where 
-
 
81
                     datediff( current_date(),added_date) < 1
-
 
82
                  ) today using (device_id)
53
                  join device using ( device_id )
83
                  join device using ( device_id )
54
               where 
84
               where 
55
                  device.device_id not in (
85
                  today.device_id is null/;
56
                     select 
-
 
57
                        distinct( device_id ) 
-
 
58
                     from 
86
                        
59
                        sysinfo_report 
-
 
60
                     where 
-
 
61
                        datediff( current_date(),added_date) < 1)/;
-
 
62
 
87
 
63
# following are used to find the configuration file
88
# following are used to find the configuration file
64
my $confFileName = "sysinfoRead.conf.yaml";
89
my $confFileName = "sysinfoRead.conf.yaml";
65
my @searchPaths = ( '/etc/camp', '/opt/camp', '/opt/camp/sysinfo', $MY_DIRECTORY );
90
my @searchPaths = ( '/etc/camp', '/opt/camp', '/opt/camp/sysinfo', $MY_DIRECTORY );
66
 
91