Viewing JTable Data

Hello everyone
I have a little problem viewing data in JTables.
When I create the JTable with 30 rows and 500 columns all the columns are initally visible. I then set the JTables preferred size to the jtable total column witdth and height. so now 8 columns are visible and nicely spaced. However, when I try to scroll to the other columns they are not visible
Help me out please anyone. (urgent)

hello,
in your InteractiveSQL class u have created the object of class ResultModel but u havent called the method setResultSet(ResultSet results).
until n unless u call this method u will not be able to see the JTable
the code will look like this.
Class InteractiveSQL .....
your code...
statement =.....
ResultSet results = statement.executeQuery("");//your select query here
model = new ResultModel();
model.setResultSet(results);// this will show u your table
your code
hope this satisfies you.

Similar Messages

  • Save a JTable (data+settings) ?

    I want to save a complete JTable.
    In my JTable I changed all,
    that means I changed the hight of a row and the length from a coloumn to have the best view of the data.
    I want to save the table with this changes.
    I used for the JTable the AbstractTableModel.
    I tried to save and load the AbstractTableModel Object with the ObjectOutputStream but it doesn't worked.
    Only the Coloumnames was showing, but that's all.
    I hope somebody can help me
    Andreas

    Your post gave me an idea and I didn't think it would work, but it seems to have done just fine. There has to be something wrong with this. It's too bizarre.import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class Test3 extends JFrame {
      String[] head = {"One","Two","Three"};
      String[][] data = {{"R1-C1","R1-C2","R1-C3"},
                         {"R2-C1","R2-C2","R2-C3"},
                         {"R3-C1","R3-C2","R3-C3"}};
      JTable jt = new JTable(data, head);
      byte[] bytes;
      Container content = getContentPane();
      int count = 0;
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        content.add(new JScrollPane(jt), BorderLayout.CENTER);
        JPanel buttonPanel = new JPanel();
        content.add(buttonPanel, BorderLayout.SOUTH);
        JButton save = new JButton("Save"), restore = new JButton("Restore");
        buttonPanel.add(save);
        buttonPanel.add(restore);
        save.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            try {
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              ObjectOutputStream oos = new ObjectOutputStream(baos);
              oos.writeObject(jt);
              oos.flush();
              oos.close();
              bytes = baos.toByteArray();
              content.add(new JPanel(), BorderLayout.CENTER);
              content.validate();
            } catch (Exception e) { e.printStackTrace(); }
        restore.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            try {
              ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
              ObjectInputStream ois = new ObjectInputStream(bais);
              JTable newTable = (JTable)ois.readObject();
              content.add(new JScrollPane(newTable), BorderLayout.CENTER);
              content.validate();
            } catch (Exception e) { e.printStackTrace(); }
        setSize(300,300);
      public static void main(String[] args) { new Test3().setVisible(true); }
    }

  • Getting an error while viewing a data in owb

    Hi,
    I created an External table based on a flat file. But I am not able to view the data in the external table while the flat file has the data.
    I am using this external table as a source in my mapping but no data is getting loaded even after the successful execution of the mapping.I am getting the following error while viewing the data
    ORA-29913: error in executing ODCIEXTTABLEFETCH callout
    ORA-29400: data cartridge error
    KUP-04040: file ATLAS in ATLAS_LOCATION1 not found
    Please help me regarding this. I am new to the owb 11g.

    Thanks for you reply. Still I can't view the data. Actually what i did is imported a .csv file using files then created a external table configured , validated and deployed.In next step created a mapping with this excel this using table operator validated and genrated code. In next step using the control center manager i deployed it. But i can't view the data still in the external table.
    Is this procedure is correct for loading the excel sheet in to databse. My client environment is on windows xp and database is on linux environment.
    Please help me regarding this.I am new to owb.

  • Can't view my data on my table in EM

    Can anyone tell me why I am getting the error below after executing my control file and also why I can't view that data which was loaded.
    SQL*Loader: Release 10.2.0.1.0 - Production on Thu Jul 12 16:28:57 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Control File: workattribute2.ctl
    Data File: workattribute.dat
    Bad File: workattribute.bad
    Discard File: none specified
    (Allow all discards)
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array: 64 rows, maximum of 256000 bytes
    Continuation: none specified
    Path used: Conventional
    Table WORKATTRIBUTE, loaded from every logical record.
    Insert option in effect for this table: APPEND
    Column Name Position Len Term Encl Datatype
    RESUMEID FIRST * CHARACTER
    Terminator string : 'x'09''
    WORKID NEXT * CHARACTER
    Terminator string : 'x'09''
    ID NEXT * CHARACTER
    Terminator string : 'x'09''
    TYPE NEXT * CHARACTER
    Terminator string : 'x'09''
    Record 1: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 2: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 3: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 4: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 5: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 6: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 7: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 8: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 9: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 10: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 11: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 12: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 13: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 14: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 15: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 16: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 17: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 18: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 19: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 20: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 21: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 22: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 23: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 24: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 25: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 26: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 27: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 28: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 29: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 30: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 31: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 32: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 33: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 34: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 35: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 36: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 37: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 38: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 39: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 40: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 41: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 42: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 43: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 44: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 45: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 46: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 47: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 48: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 49: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 50: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    Record 51: Rejected - Error on table WORKATTRIBUTE, column RESUMEID.
    Field in data file exceeds maximum length
    MAXIMUM ERROR COUNT EXCEEDED - Above statistics reflect partial run.
    Table WORKATTRIBUTE:
    0 Rows successfully loaded.
    51 Rows not loaded due to data errors.
    0 Rows not loaded because all WHEN clauses were failed.
    0 Rows not loaded because all fields were null.
    Space allocated for bind array: 66048 bytes(64 rows)
    Read buffer bytes: 1048576
    Total logical records skipped: 0
    Total logical records read: 51
    Total logical records rejected: 51
    Total logical records discarded: 0
    Run began on Thu Jul 12 16:28:57 2007
    Run ended on Thu Jul 12 16:29:05 2007
    Elapsed time was: 00:00:08.09
    CPU time was: 00:00:00.12
    thank you in advance

    Hi User572297,
    This is the wrong forum for a SQL Loader Q, not a bad thing, you just won't get as many responses.
    That said, it seems either your terminator string is not present, incorrect or you are simply trying to load to many characters into a column that is too small. For ex: trying to load 50 characters into a Varchar2(40). You get this error for every row, hence you can not see any of the data, becuase none of the rows loaded. See below:
    0 Rows successfully loaded.
    51 Rows not loaded due to data errors.
    What would help is to know the datatype and size of the RESUMEID column AND to see the first lines of your workattribute.dat file.

  • Can't view changed data in journal data

    Hi,
    I have implemented JKM Oracle 10g Consistent Logminer on Oracle 10g with the following option.
    - Asynchronous_mode : yes
    - Auto_configuration : yes
    1. Change Data Capture -> Add to CDC, 2.Subscriber->subscribe (sunopsis),
    3. Start Journal
    The journal has been started correctly wothout errors. The journalized table has always the symbol "green clock". All is gook working.
    And then i inserted 1 record in source table, but i can't view changed data in journal data. I can't understand why journal data was generated.
    There are no errors.
    Help me !!!

    Did your designer was on the good context ?
    Look the list box at the top right of the Designer interface.
    You must have the same as the one where you define your journalization.

  • I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.

    I was told of an application that will allow the use of a second screen to view my data and files, but I forgot its name. I'd like to make the connection because my LCD is broken.

    You don't need an application, just plug a compaitble monitor into the display port of your MacBook Pro, set the screen up in System Preferences>Displays

  • When attempting to view the date track history for one employee, errors out

    Hi All
    When I attempt to view the date track history for one employee, it gives errors.
    To get the details, the navigation is :
    1. Search for employee xxxxxx
    2. click on Assignment button
    3. click on Date Track History.
    4. Receive error APP-DT-52554.
    5. Click OK on error message
    6. click on Full History button.
    7. Receive error APP-PAY-06153
    What could be the problem and how to solve this?
    Regards
    Rahman

    Sounds as if there is an inconsistency with the date tracked records. Can you check the records through TOAD or SQL Plus?
    Have alook at MetaLInk article 343070.1 which refers to the second error message.
    Regards
    Tim

  • Not able to view XML data

    Hello All,
    I want to generate xml data file from sql query.So i created a new report and new data model whose type is SQL query and following is the query
    select p.name as name,s.size_desc as sizes,sum(f.quantity) as quantity
    from s_article_poc14073 p,s_size_poc14073 s,s_factsize_poc14073 f
    where p.id = f.prod_id and s.size_id = f.size_id and p.id > 4
    group by p.name,s.size_desc
    order by 1
    I have not given any Layout and when i view the data ,i get only the folowing
    <?xml version="1.0" encoding="UTF-8" ?>
    <ROWSET />
    Therez no error with the sql query ,any help on this please
    Thanks in advance
    Sulakshana

    Hi,
    Yes my query returns rows when i run directly from the backend.
    I have not defined any layout,because i just want the data to be generated as a xml file.
    Thanks
    Sulakshana

  • Unable to  view the data in infoobject

    Hi all,
    I am loading the data to info-obj this is the first time i am working on BI 7. everything is successfull. i had created the transformation and dtp successfully n in monitor screen its showing that the data has been loaded sucessfully. the thing is i didnt maintain a infosource as i am loading the data from the only one DS to one info obj. i am able to view the data in the psa but when i try to view the data in the infoobject its not der.
    plz help me out
    Thank & Regards
    KK

    Since you are using BI 7 for the first time., I hope you have executed the DTP after executing the infopackage.
    In BW 3.5 we can load date from data source to Infoobject via PSA in one shot.
    But In BI 7, we have to execute the infopackage first . This loads data from Datasource to PSA. Then you need to execute the DTP. Just double click on the DTP. You can see the execute in the third tab. When you execute the DTP, data will be further loaded from PSA to Infoobject.

  • I can view the data in front end form, but data is not avilable in backend

    Hi,
    i created a form with three blocks.In first block i entered the data.Based on the data it will fetch recodrs from A & B tables and insert into C table.This logic i have written in backend and put commit in front end and back end. In the 2nd block iam using C table. i can view the data in front end(C table) . But i unable to
    see the data in C table when i go and see in back end.
    Form is used for only querying purpose. for the C block insert allowed and update allowed is false.
    Plz do the need ful

    Please try and post sufficient information for someone to replicate your problem. We are not looking over your shoulder and do not have access to your database.
    We need a minimum table structure, example data, a walk-through of how the form works - you mention 3 blocks and only half-way describe 1. Is another for the C block? Or is that a different form?
    e.g. Enter search data in Block A. Execute Query. Blocks A and B populated with data from database tables based on FK relationship B to A. User presses Save button, procedure in form updates table C based on data in form and issues commit. Execute Query in Block C retrieves just inserted data in table C.
    Is that remotely what's happening? Or something completely different?

  • How to add an index to a materialized view in Data Modeler 3.3

    Hello everyone,
    I'm looking for a how-to to add an index to a materialized view in Data Modeler 3.3.0.747, as I coudn't find a way to do it so far.
    I looked here:
    Relational Model
    Physical Model
    Oracle 11g
    Materialized Views
    "my_mv_name"
    "INDEXES" IS NOT HERE IN THE TREE
    "Tables" does not include it either
    Thank you & Best regards,
    Blama

    Hi David,
    thanks a lot. I did so and it worked, but I found a minor bug while doing so:
    I marked the table as "Implement as Materialized View" and went to File->Export->DDL (for Oracle 11g).
    The generated code (I checked all options in "Drop Selection") includes a row:
    DROP MATERIALIZED VIEW mv_mymatview CASCADE CONSTRAINTS ;
    which produces a syntax error.
    Best regards,
    Blama

  • How can i view the data from Access DB in oracle

    pls tell me that how can i view the data of MS ACCESS DATABASE in ORACLE.i was use ODBC of ACCESS DATABASE AND THEN CREATE DATABASE LINK IN ORACLE BUT NOT YET SUCCEEDED.PLS TELL ME THE PROCEDURE.
    regard's

    hi,
    u nedd to use Oracle Hetrogeneous Services,,
    full details of the procedure u may fing on metalink
    Regards

  • Issue in viewing the data

    Hi All,
    We are working on EP 6 and ECC 6 and facing a problem of viewing the data.
    For Ex :
    When we log in to the portal and click on any of the hyperlinks provided for example Who's Who or in Personnel Information => Address ..the link dosen't work or open at all neither we get any errors.
    We have assigned all the roles required for the User and also in IT 0105 subtype 0001 is mainted.
    Request you all to let me know reasons
    Thanks for all your support.
    Thanks
    YM

    Hi Sridhar,
    Thanks for your valauble inputs.
    I did review the config and found that the PERNR is assigned. The SPRO config also looks fine.
    One more thing is that our Basis Consultant is able to view and edit the details. He has superuser roles and J2EE admin roles, but as per my knowlegde these roles are not assigned to everyone.When these roles where assigned to other users they were able to view.
    So looks like Business Package is also fine then what could be the reason ???
    Please let me know
    Cheers
    YM

  • [SOLVED] Can't view Monitorix data

    I installed Monitorix on my home server and want it to work together with an Apache HTTP server. I think I configured it correctly, and I can reach Monitorix's home page, but when I click on 'OK' to view the data, instead what I get is what I assume to be a perl script:
    #!/usr/bin/env perl
    # Monitorix - A lightweight system monitoring tool.
    # Copyright (C) 2005-2015 by Jordi Sanfeliu <[email protected]>
    # 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.
    use strict;
    use warnings;
    use FindBin qw($Bin);
    use lib $Bin . "/lib", "/usr/lib/monitorix";
    use Monitorix;
    use CGI qw(:standard);
    use Config::General;
    use POSIX;
    use RRDs;
    my %config;
    my %cgi;
    my %colors;
    my %tf;
    my @version12;
    my @version12_small;
    sub multihost {
    my ($config, $colors, $cgi) = @_;
    my $n;
    my $n2;
    my @host;
    my @url;
    my @foot_url;
    my $multihost = $config->{multihost};
    if($cgi->{val} =~ m/group(\d*)/) {
    my @remotegroup_desc;
    # all groups
    if($cgi->{val} eq "group") {
    my @remotegroup_list = split(',', $multihost->{remotegroup_list});
    for($n = 0; $n < scalar(@remotegroup_list); $n++) {
    scalar(my @tmp = split(',', $multihost->{remotegroup_desc}->{$n}));
    for($n2 = 0; $n2 < scalar(@tmp); $n2++) {
    push(@remotegroup_desc, trim($tmp[$n2]));
    # specific group
    if($cgi->{val} =~ m/group(\d+)/) {
    my $gnum = int($1);
    @remotegroup_desc = split(',', $multihost->{remotegroup_desc}->{$gnum});
    my @remotehost_list = split(',', $multihost->{remotehost_list});
    for($n = 0; $n < scalar(@remotegroup_desc); $n++) {
    my $h = trim($remotegroup_desc[$n]);
    for($n2 = 0; $n2 < scalar(@remotehost_list); $n2++) {
    my $h2 = trim($remotehost_list[$n2]);
    if($h eq $h2) {
    push(@host, $h);
    push(@url, (split(',', $multihost->{remotehost_desc}->{$n2}))[0] . (split(',', $multihost->{remotehost_desc}->{$n2}))[2]);
    push(@foot_url, (split(',', $multihost->{remotehost_desc}->{$n2}))[0] . (split(',', $multihost->{remotehost_desc}->{$n2}))[1]);
    } else {
    my @remotehost_list = split(',', $multihost->{remotehost_list});
    for($n = 0; $n < scalar(@remotehost_list); $n++) {
    push(@host, trim($remotehost_list[$n]));
    push(@url, (split(',', $multihost->{remotehost_desc}->{$n}))[0] . (split(',', $multihost->{remotehost_desc}->{$n}))[2]);
    push(@foot_url, (split(',', $multihost->{remotehost_desc}->{$n}))[0] . (split(',', $multihost->{remotehost_desc}->{$n}))[1]);
    $multihost->{graphs_per_row} = 1 unless $multihost->{graphs_per_row} > 1;
    my $graph = ($cgi->{graph} eq "all" || $cgi->{graph} =~ m/group\[0-9]*/) ? "_system1" : $cgi->{graph};
    if($cgi->{val} eq "all" || $cgi->{val} =~ m/group[0-9]*/) {
    for($n = 0; $n < scalar(@host); $n += $multihost->{graphs_per_row}) {
    print "<table cellspacing='5' cellpadding='0' width='1' bgcolor='$colors->{graph_bg_color}' border='1'>\n";
    print " <tr>\n";
    for($n2 = 0; $n2 < $multihost->{graphs_per_row}; $n2++) {
    if($n < scalar(@host)) {
    print " <td bgcolor='$colors->{title_bg_color}'>\n";
    print " <font face='Verdana, sans-serif' color='$colors->{fg_color}'>\n";
    print " <b>&nbsp;&nbsp;" . $host[$n] . "</b>\n";
    print " </font>\n";
    print " </td>\n";
    $n++;
    print " </tr>\n";
    print " <tr>\n";
    for($n2 = 0, $n = $n - $multihost->{graphs_per_row}; $n2 < $multihost->{graphs_per_row}; $n2++) {
    if($n < scalar(@host)) {
    print " <td bgcolor='$colors->{title_bg_color}' style='vertical-align: top; height: 10%; width: 10%;'>\n";
    print " <iframe src='" . $url[$n] . "/monitorix.cgi?mode=localhost&when=$cgi->{when}&graph=$graph&color=$cgi->{color}&silent=imagetag' height=201 width=397 frameborder=0 marginwidth=0 marginheight=0 scrolling=no></iframe>\n";
    print " </td>\n";
    $n++;
    print " </tr>\n";
    print " <tr>\n";
    for($n2 = 0, $n = $n - $multihost->{graphs_per_row}; $n2 < $multihost->{graphs_per_row}; $n2++) {
    if($n < scalar(@host)) {
    if(lc($multihost->{footer_url}) eq "y") {
    print " <td bgcolor='$colors->{title_bg_color}'>\n";
    print " <font face='Verdana, sans-serif' color='$colors->{title_fg_color}'>\n";
    print " <font size='-1'>\n";
    print " <b>&nbsp;&nbsp;<a href='" . $foot_url[$n] . "' style='color: " . $colors->{title_fg_color} . ";'>$foot_url[$n]</a></b>\n";
    print " </font></font>\n";
    print " </td>\n";
    $n++;
    $n = $n - $multihost->{graphs_per_row};
    print " </tr>\n";
    print "</table>\n";
    print "<br>\n";
    } else {
    print " <table cellspacing='5' cellpadding='0' width='1' bgcolor='$colors->{graph_bg_color}' border='1'>\n";
    print " <tr>\n";
    print " <td bgcolor='$colors->{title_bg_color}'>\n";
    print " <font face='Verdana, sans-serif' color='$colors->{fg_color}'>\n";
    print " <b>&nbsp;&nbsp;" . $host[$cgi->{val}] . "</b>\n";
    print " </font>\n";
    print " </td>\n";
    print " </tr>\n";
    print " <tr>\n";
    print " <td bgcolor='$colors->{title_bg_color}' style='vertical-align: top; height: 10%; width: 10%;'>\n";
    print " <iframe src='" . (split(',', $multihost->{remotehost_desc}->{$cgi->{val}}))[0] . (split(',', $multihost->{remotehost_desc}->{$cgi->{val}}))[2] . "/monitorix.cgi?mode=localhost&when=$cgi->{when}&graph=$graph&color=$cgi->{color}&silent=imagetagbig' height=249 width=545 frameborder=0 marginwidth=0 marginheight=0 scrolling=no></iframe>\n";
    print " </td>\n";
    print " </tr>\n";
    print " <tr>\n";
    if(lc($multihost->{footer_url}) eq "y") {
    print " <td bgcolor='$colors->{title_bg_color}'>\n";
    print " <font face='Verdana, sans-serif' color='$colors->{title_fg_color}'>\n";
    print " <font size='-1'>\n";
    print " <b>&nbsp;&nbsp;<a href='" . $foot_url[$cgi->{val}] . "' style='color: " . $colors->{title_fg_color} . ";'>$foot_url[$cgi->{val}]</a></b>\n";
    print " </font></font>\n";
    print " </td>\n";
    print " </tr>\n";
    print " </table>\n";
    print " <br>\n";
    sub graph_header {
    my ($title, $colspan) = @_;
    print("\n");
    print("<!-- graph table begins -->\n");
    print(" <table cellspacing='5' cellpadding='0' width='1' bgcolor='$colors{graph_bg_color}' border='1'>\n");
    print(" <tr>\n");
    print(" <td bgcolor='$colors{title_bg_color}' colspan='$colspan'>\n");
    print(" <font face='Verdana, sans-serif' color='$colors{title_fg_color}'>\n");
    print(" <b>&nbsp;&nbsp;$title</b>\n");
    print(" </font>\n");
    print(" </td>\n");
    print(" </tr>\n");
    sub graph_footer {
    print(" </table>\n");
    print("<!-- graph table ends -->\n");
    # MAIN
    open(IN, "< monitorix.conf.path");
    my $config_path = <IN>;
    chomp($config_path);
    close(IN);
    if(! -f $config_path) {
    print(<< "EOF");
    Content-Type: text/plain
    <pre>
    FATAL: Monitorix is unable to continue!
    =======================================
    File 'monitorix.conf.path' was not found.
    Please make sure that 'base_dir' option is correctly configured and this
    CGI (monitorix.cgi) is located in the 'base_dir'/cgi/ directory.
    And don't forget to restart Monitorix for the changes to take effect!
    EOF
    die "FATAL: File 'monitorix.conf.path' was not found!";
    # load main configuration file
    my $conf = new Config::General(
    -ConfigFile => $config_path,
    %config = $conf->getall;
    # load additional configuration files
    if($config{include_dir} && opendir(DIR, $config{include_dir})) {
    my @files = grep { !/^[.]/ } readdir(DIR);
    closedir(DIR);
    foreach my $c (sort @files) {
    next unless -f $config{include_dir} . "/$c";
    next unless $c =~ m/\.conf$/;
    my $conf_inc = new Config::General(
    -ConfigFile => $config{include_dir} . "/$c",
    my %config_inc = $conf_inc->getall;
    while(my ($key, $val) = each(%config_inc)) {
    if(ref($val) eq "HASH") {
    # two level options
    while(my ($key2, $val2) = each(%{$val})) {
    if(ref($val2) eq "HASH") {
    # three level options
    while(my ($key3, $val3) = each(%{$val2})) {
    $config{$key}->{$key2}->{$key3} = $val3;
    delete $config_inc{$key}->{$key2}->{$key3};
    next;
    $config{$key}->{$key2} = $val2;
    delete $config_inc{$key}->{$key2};
    next;
    # graph_name option is special
    if($key eq "graph_name") {
    $config{graph_name} .= ", $val";
    delete $config_inc{graph_name};
    next;
    # one level options
    $config{$key} = $val;
    delete $config_inc{$key};
    $config{url} = ($config{url_prefix_proxy} || "");
    if(!$config{url}) {
    $config{url} = ($ENV{HTTPS} || ($config{httpd_builtin}->{https_url} || "n") eq "y") ? "https://" . $ENV{HTTP_HOST} : "http://" . $ENV{HTTP_HOST};
    $config{hostname} = $config{hostname} || $ENV{SERVER_NAME};
    if(!($config{hostname})) { # called from the command line
    $config{hostname} = "127.0.0.1";
    $config{url} = "http://127.0.0.1";
    $config{url} .= $config{base_url};
    our $mode = defined(param('mode')) ? param('mode') : '';
    our $graph = param('graph');
    our $when = param('when');
    our $color = param('color');
    our $val = defined(param('val')) ? param('val') : '';
    our $silent = defined(param('silent')) ? param('silent') : '';
    if($mode ne "localhost") {
    ($mode, $val) = split(/\./, $mode);
    if(lc($config{httpd_builtin}->{enabled}) ne "y") {
    print("Content-Type: text/html\n");
    print("\n");
    # get the current OS and kernel version
    my $release;
    ($config{os}, undef, $release) = uname();
    if(!($release =~ m/^(\d+)\.(\d+)/)) {
    die "FATAL: unable to get the kernel version.";
    $config{kernel} = "$1.$2";
    $colors{graph_colors} = ();
    $colors{warning_color} = "--color=CANVAS#880000";
    # keep backwards compatibility for v3.2.1 and less
    if(ref($config{theme}) ne "HASH") {
    delete($config{theme});
    if(!$config{theme}->{$color}) {
    $color = "white";
    $config{theme}->{$color}->{main_bg} = "FFFFFF";
    $config{theme}->{$color}->{main_fg} = "000000";
    $config{theme}->{$color}->{title_bg} = "777777";
    $config{theme}->{$color}->{title_fg} = "CCCC00";
    $config{theme}->{$color}->{graph_bg} = "CCCCCC";
    $config{theme}->{$color}->{gap} = "000000";
    if($color eq "black") {
    push(@{$colors{graph_colors}}, "--color=CANVAS#" . $config{theme}->{$color}->{canvas});
    push(@{$colors{graph_colors}}, "--color=BACK#" . $config{theme}->{$color}->{back});
    push(@{$colors{graph_colors}}, "--color=FONT#" . $config{theme}->{$color}->{font});
    push(@{$colors{graph_colors}}, "--color=MGRID#" . $config{theme}->{$color}->{mgrid});
    push(@{$colors{graph_colors}}, "--color=GRID#" . $config{theme}->{$color}->{grid});
    push(@{$colors{graph_colors}}, "--color=FRAME#" . $config{theme}->{$color}->{frame});
    push(@{$colors{graph_colors}}, "--color=ARROW#" . $config{theme}->{$color}->{arrow});
    push(@{$colors{graph_colors}}, "--color=SHADEA#" . $config{theme}->{$color}->{shadea});
    push(@{$colors{graph_colors}}, "--color=SHADEB#" . $config{theme}->{$color}->{shadeb});
    push(@{$colors{graph_colors}}, "--color=AXIS#" . $config{theme}->{$color}->{axis})
    if defined($config{theme}->{$color}->{axis});
    $colors{bg_color} = $config{theme}->{$color}->{main_bg};
    $colors{fg_color} = $config{theme}->{$color}->{main_fg};
    $colors{title_bg_color} = $config{theme}->{$color}->{title_bg};
    $colors{title_fg_color} = $config{theme}->{$color}->{title_fg};
    $colors{graph_bg_color} = $config{theme}->{$color}->{graph_bg};
    $colors{gap} = $config{theme}->{$color}->{gap};
    ($tf{twhen}) = ($when =~ m/(hour|day|week|month|year)$/);
    ($tf{nwhen} = $when) =~ s/$tf{twhen}// unless !$tf{twhen};
    $tf{nwhen} = 1 unless $tf{nwhen};
    $tf{twhen} = "day" unless $tf{twhen};
    $tf{when} = $tf{nwhen} . $tf{twhen};
    # toggle this to 1 if you want to maintain old (2.3-) Monitorix with Multihost
    if($config{backwards_compat_old_multihost}) {
    $tf{when} = $tf{twhen};
    our ($res, $tc, $tb, $ts);
    if($tf{twhen} eq "day") {
    ($tf{res}, $tf{tc}, $tf{tb}, $tf{ts}) = (3600, 'h', 24, 1);
    if($tf{twhen} eq "week") {
    ($tf{res}, $tf{tc}, $tf{tb}, $tf{ts}) = (108000, 'd', 7, 1);
    if($tf{twhen} eq "month") {
    ($tf{res}, $tf{tc}, $tf{tb}, $tf{ts}) = (216000, 'd', 30, 1);
    if($tf{twhen} eq "year") {
    ($tf{res}, $tf{tc}, $tf{tb}, $tf{ts}) = (5184000, 'd', 365, 1);
    if($RRDs::VERSION > 1.2) {
    push(@version12, "--slope-mode");
    push(@version12, "--font=LEGEND:7:");
    push(@version12, "--font=TITLE:9:");
    push(@version12, "--font=UNIT:8:");
    if($RRDs::VERSION >= 1.3) {
    push(@version12, "--font=DEFAULT:0:Mono");
    if($tf{twhen} eq "day") {
    push(@version12, "--x-grid=HOUR:1:HOUR:6:HOUR:6:0:%R");
    push(@version12_small, "--font=TITLE:8:");
    push(@version12_small, "--font=UNIT:7:");
    if($RRDs::VERSION >= 1.3) {
    push(@version12_small, "--font=DEFAULT:0:Mono");
    if(!$silent) {
    my $title;
    my $str;
    my $piwik_code = "";
    my ($piwik_url, $piwik_sid, $piwik_img);
    # Piwik tracking code
    if(lc($config{piwik_tracking}->{enabled}) eq "y") {
    $piwik_url = $config{piwik_tracking}->{url} || "";
    $piwik_sid = $config{piwik_tracking}->{sid} || "";
    $piwik_img = $config{piwik_tracking}->{img} || "";
    $piwik_code = <<"EOF";
    <!-- Piwik -->
    <script type="text/javascript">
    var _paq = _paq || [];
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    (function() {
    var u=(("https:" == document.location.protocol) ? "https" : "http") + "$piwik_url";
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['setSiteId', $piwik_sid]);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
    g.defer=true; g.async=true; g.src=u+'piwik.js';
    s.parentNode.insertBefore(g,s);
    </script>
    <noscript>
    <p><img src="$piwik_img" style="border:0;" alt=""/></p>
    </noscript>
    <!-- End Piwik Code -->
    EOF
    print("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 3.2 Final//EN'>\n");
    print("<html>\n");
    print(" <head>\n");
    print(" <title>$config{title}</title>\n");
    print(" <link rel='shortcut icon' href='" . $config{url} . "/" . $config{favicon} . "'>\n");
    if($config{refresh_rate}) {
    print(" <meta http-equiv='Refresh' content='" . $config{refresh_rate} . "'>\n");
    print(" </head>\n");
    print(" <body bgcolor='" . $colors{bg_color} . "' vlink='#888888' link='#888888'>\n");
    print(" $piwik_code\n");
    print(" <center>\n");
    print(" <table cellspacing='5' cellpadding='0' bgcolor='" . $colors{graph_bg_color} . "' border='1'>\n");
    print(" <tr>\n");
    if(($val ne "all" || $val ne "group") && $mode ne "multihost") {
    print(" <td bgcolor='" . $colors{title_bg_color} . "'>\n");
    print(" <font face='Verdana, sans-serif' color='" . $colors{title_fg_color} . "'>\n");
    print(" <font size='5'><b>&nbsp;&nbsp;Host:&nbsp;</b></font>\n");
    print(" </font>\n");
    print(" </td>\n");
    if($val =~ m/group(\d+)/) {
    my $gnum = $1;
    my $gname = (split(',', $config{multihost}->{remotegroup_list}))[$gnum];
    $gname = trim($gname);
    print(" <td bgcolor='" . $colors{title_bg_color} . "'>\n");
    print(" <font face='Verdana, sans-serif' color='" . $colors{title_fg_color} . "'>\n");
    print(" <font size='5'><b>&nbsp;&nbsp;$gname&nbsp;</b></font>\n");
    print(" </font>\n");
    print(" </td>\n");
    print(" <td bgcolor='" . $colors{bg_color} . "'>\n");
    print(" <font face='Verdana, sans-serif' color='" . $colors{fg_color} . "'>\n");
    if($mode eq "localhost" || $mode eq "traffacct") {
    $title = $config{hostname};
    } elsif($mode eq "multihost") {
    $graph = $graph eq "all" ? "_system1" : $graph;
    my ($g1, $g2) = ($graph =~ /(_\D+).*?(\d)$/);
    if($g1 eq "_port") {
    $title = $config{graphs}->{$g1};
    $g2 = trim((split(',', $config{port}->{list}))[$g2]);
    $title .= " " . $g2;
    $g2 = (split(',', $config{port}->{desc}->{$g2}))[0];
    $title .= " (" . trim($g2) . ")";
    } else {
    $g2 = "" if $g1 eq "_proc"; # '_procn' must be converted to '_proc'
    $title = $config{graphs}->{$g1 . $g2};
    $title =~ s/ /&nbsp;/g;
    print(" <font size='5'><b>&nbsp;&nbsp;$title&nbsp;&nbsp;</b></font>\n");
    print(" </font>\n");
    print(" </td>\n");
    print(" <td bgcolor='" . $colors{title_bg_color} . "'>\n");
    print(" <font face='Verdana, sans-serif' color='" . $colors{title_fg_color} . "'>\n");
    print(" <font size='5'><b>&nbsp;&nbsp;last&nbsp;$tf{twhen}&nbsp;&nbsp;</b></font>\n");
    print(" </font>\n");
    print(" </td>\n");
    print(" </tr>\n");
    print(" </table>\n");
    print(" <font face='Verdana, sans-serif' color='" . $colors{fg_color} . "'>\n");
    print(" <h4><font color='#888888'>" . strftime("%a %b %e %H:%M:%S %Z %Y", localtime) . "</font></h4>\n");
    $cgi{colors} = \%colors;
    $cgi{tf} = \%tf;
    $cgi{version12} = \@version12;
    $cgi{version12_small} = \@version12_small;
    $cgi{graph} = $graph;
    $cgi{when} = $when;
    $cgi{color} = $color;
    $cgi{val} = $val;
    $cgi{silent} = $silent;
    if($mode eq "localhost") {
    foreach (split(',', $config{graph_name})) {
    my $gn = trim($_);
    my $g = "";
    if($graph ne "all") {
    ($g) = ($graph =~ m/^_*($gn)\d*$/);
    next unless $g;
    if(lc($config{graph_enable}->{$gn}) eq "y") {
    my $cgi = $gn . "_cgi";
    eval "use $gn qw(" . $cgi . ")";
    if($@) {
    print(STDERR "WARNING: unable to load module '$gn. $@'\n");
    next;
    if($graph eq "all" || $gn eq $g) {
    no strict "refs";
    &$cgi($gn, \%config, \%cgi);
    } elsif($mode eq "multihost") {
    multihost(\%config, \%colors, \%cgi);
    } elsif($mode eq "traffacct") {
    eval "use $mode qw(traffacct_cgi)";
    if($@) {
    print(STDERR "WARNING: unable to load module '$mode'. $@\n");
    exit;
    traffacct_cgi($mode, \%config, \%cgi);
    if(!$silent) {
    print("\n");
    print(" </font>\n");
    print(" </center>\n");
    print("<!-- footer begins -->\n");
    print(" <p>\n");
    print(" <a href='http://www.monitorix.org'><img src='" . $config{url} . "/" . $config{logo_bottom} . "' border='0'></a>\n");
    print(" <br>\n");
    print(" <font face='Verdana, sans-serif' color='" . $colors{fg_color} . "' size='-2'>\n");
    print("Copyright &copy; 2005-2015 Jordi Sanfeliu\n");
    print(" </font>\n");
    print(" </body>\n");
    print("</html>\n");
    print("<!-- footer ends -->\n");
    0;
    Last edited by joaocandre (2015-03-15 20:45:19)

    karol wrote:Have you read https://wiki.archlinux.org/index.php/Mo … torix_Data ?
    I did, anything I'm missing? I'm sure base_dir is correctly set up in the config file. Other than that, the wiki article doesn't have any information if there's any additional steps to set it up on an Apache server.

  • SBS 2011 VM and Server 2012 R2 Hyper-V host. After rebuilding the host image, no email is received, EMC states "You don't have sufficient permissions to view this data" when looking at organization config. Server config not shown on EMC.

    Hyper-V Host Server 2012 R2 x64 drive c:
    All VMs, including SBS 2011 Standard x64 are on drive d:
    I replaced my motherboard and defined a Marvell RAID 1 Mirror for my boot drive C:.  My drive D: containing all of my Hyper V machines remained untouched since the new MB had Intel Matrix Controller with RAID 5, as did the old MB.
    Since the C: drives are a few bytes smaller after configured as a RAID 1, I was unable to restore drive C from the image copy, so I rebuilt a new Hyper-V Host identical as possible using Server 2012 R2 x64.  I had to redefine the Hyper-V machines on
    the host, and the 1st time I brought it all (host and VMs) I had to reconfigure the NICs due to new MAC addresses, and verifying SBS 2011 DNS and DHCP for all physical and Hyper-V machines. Otherwise my Hyper-V SBS 2011 x(64) wasn't touched.
    Now the SBS Exchange 2010 is not receiving mail.  In the Exchange Management Console clicking on the Organization config gives me a highlighted error "You don't have sufficient permissions to view this data".  The Server
    Config is no longer on the EMC.  The Recipient Config looks fine.
    Outlook 2013 x64 connects to the Exchange Server, but no new mail appeared.  There were just a few older messages that came in since the last time I opened Outlook.  My public DNS on GoDaddy was not changed.  I did not change sending mail
    through my ISP Sonic.net.  The SBS internal DNS doesn't have an MX record, but I'm not sure it ever did since my GoDaddy public DNS has an MX record.
    I tried restoring to an earlier Image Copy, but that made no difference.  I'm using the Windows Backup from SBS 2011 for my daily image copy backups.
    - Michael Faklis

    Hi Michael,
    à
    After more research and running the Best Practices report from the EMC, I am missing a slew of ManagementRolesAndRoleGroups from the RBAC container.
    Based on your description, it seems that you have find the cause of this issue. On current situation, I still
    suggest that you should run
    SBS 2011 BPA and then check if can find some relevant errors. Just for a confirmation.
    Meanwhile, please refer to following articles and check if can help you.
    Apply
    missing Exchange 2010 RBAC Management Roles and Policies
    RBAC Manager
    (Exchange 2010 SP2)
    Hope this helps.
    Best regards,
    Justin Gu

Maybe you are looking for