Page 1 of 1

maintenance php error

PostPosted: Thu Dec 19, 2013 7:25 pm
by atalon
Code: Select all
php maintenance.php cleardata 2 olderthan 86400
Num.    Facility .      Debug Message


        Critical Error occured  -       Errordetails:
        Logstream Source with ID '2' could not be found in the Database!

        Terminating now!

I arbitrarily tried ID '1' and it didn't work either. How do I find out what my Logstream Source ID is?

Re: maintenance php error

PostPosted: Thu Dec 19, 2013 8:54 pm
by atalon
Running RHEL6 and mysql by the way.

Re: maintenance php error

PostPosted: Fri Dec 20, 2013 9:16 am
by alorbach
Hi,

take a look to the querystring when you run a search in Loganalyzer. It contains the logstream ID in it's parameters.

best regards,
Andre Lorbach

Re: maintenance php error

PostPosted: Fri Dec 20, 2013 2:29 pm
by atalon
This is what I see below. IF the stream id is "1123" then each entry has its own number, so how to I say all numbers before a date or so many days for the maintenance tool?

Image

Re: maintenance php error

PostPosted: Fri Jan 03, 2014 12:07 pm
by alorbach
Get the LogStreamID by looking at the selected source on the upper right.

Re: maintenance php error

PostPosted: Tue Mar 11, 2014 5:54 pm
by atalon
The only source shown is "My Syslog Source" how does this translate to a number to put in the command for the maintenance page? Or do I type out the words in quotes?

Re: maintenance php error

PostPosted: Wed Mar 12, 2014 10:14 am
by alorbach
Take a look to the URL, it contains an ID parameter.

Re: maintenance php error

PostPosted: Thu Mar 13, 2014 3:41 pm
by atalon
The URL is shown in the picture above and it only shows the uID (message ID) and not the LogStreamID as I understand it. Maybe you can show me a picture of what you are trying to get me to see since it is not showing up in my picture and we are not understanding each other.

Re: maintenance php error

PostPosted: Fri Mar 14, 2014 12:55 pm
by alorbach
Kindly go to the index, switch source and switch back. You will see the sourceid in the url parameters.

best regards,
Andre Lorbach

PS: Alternative go to the Admin Center and look into the Sources Admin.

Re: maintenance php error

PostPosted: Fri Mar 14, 2014 2:04 pm
by atalon
There is only 1 source. There is no switching.

I could not get the userDB working on Redhat 6.4 so I don't have an admin center. (or am I mistaken?)

Re: maintenance php error

PostPosted: Fri Mar 14, 2014 4:59 pm
by alorbach
Then take a look to the config.php, at the end you should see the configured sourceid.

best regards,
Andre

Re: maintenance php error

PostPosted: Fri Mar 14, 2014 8:30 pm
by atalon
This still is not working. Here is the end of the file with the SourceID defined.
Code: Select all
$CFG['DefaultSourceID'] = 'Source1';

$CFG['Sources']['Source1']['ID'] = 'Source1';
$CFG['Sources']['Source1']['Name'] = 'My Syslog Source';
$CFG['Sources']['Source1']['ViewID'] = 'SYSLOG';
$CFG['Sources']['Source1']['SourceType'] = SOURCE_DB;
$CFG['Sources']['Source1']['DBTableType'] = 'monitorware';
$CFG['Sources']['Source1']['DBType'] = DB_MYSQL;
$CFG['Sources']['Source1']['DBServer'] = 'localhost';
$CFG['Sources']['Source1']['DBName'] = 'rsysdb';
$CFG['Sources']['Source1']['DBUser'] = 'rsyslog';
$CFG['Sources']['Source1']['DBPassword'] = 'XXXXX';
$CFG['Sources']['Source1']['DBTableName'] = 'SystemEvents';
$CFG['Sources']['Source1']['DBEnableRowCounting'] = true;



And here are the different iterations I tried for the source id
Code: Select all
 php maintenance.php cleardata Source1 olderthan 86400
Num.    Facility .      Debug Message


        Critical Error occured  -       Errordetails:
        Logstream Source with ID '0' could not be found in the Database!

        Terminating now!
[root@vseapps029 cron]# php maintenance.php cleardata "Source1" olderthan 86400
Num.    Facility .      Debug Message


        Critical Error occured  -       Errordetails:
        Logstream Source with ID '0' could not be found in the Database!

        Terminating now!
[root@vseapps029 cron]# php maintenance.php cleardata 1 olderthan 86400
Num.    Facility .      Debug Message


        Critical Error occured  -       Errordetails:
        Logstream Source with ID '1' could not be found in the Database!

        Terminating now!
[root@vseapps029 cron]# php maintenance.php cleardata 'Source1' olderthan 86400
Num.    Facility .      Debug Message


        Critical Error occured  -       Errordetails:
        Logstream Source with ID '0' could not be found in the Database!

        Terminating now!


So the error messages would suggest that it should be a number or the maintenance.php is expecting a number when it is a string.

Re: maintenance php error

PostPosted: Mon Mar 17, 2014 10:28 am
by alorbach
There is a typo in your command:
Code: Select all
php maintenance.php clea[b]n[/b]data Source1 olderthan 86400


Anyway there is indeed a bug in the maintenance script which hasn't been detected before,
The sourceid is forced to an integer which causes the script to fail.

To fix this please edit mainrtenance.php, search for:
Code: Select all
      // Set to SourceID property!
      $content['SOURCEID'] = intval( $_SERVER["argv"][2] );


replace with
Code: Select all
      // Set to SourceID property!
      $content['SOURCEID'] = $_SERVER["argv"][2];


best regards,
Andre Lorbach

Re: maintenance php error

PostPosted: Wed Mar 19, 2014 5:50 pm
by atalon
This worked. I am now able to use the maintenance.php "script"

Also please remove the DBpassword from my post above. I can't seem to edit the post.

Re: maintenance php error

PostPosted: Wed Mar 19, 2014 5:53 pm
by rgerhards
I removed one password, let me know if there are more. Edits are not permitted after a while to keep the threat consistent (it is really anoying when someone edits days later and the replies out of the sudden make no more sense - this *has* hapened).

Rainer