NetXMS Support Forum

English Support => General Support => Topic started by: VMGuy on January 06, 2015, 03:19:30 AM

Title: NetXMS 1.2.17 crashed and doesn't start anymore
Post by: VMGuy on January 06, 2015, 03:19:30 AM
Hi,

I just had/have a strange issue where the backend crashed and isn't able to start anymore.

That's what happened:
- I created a new script in the script library
- When I was finished I closed the script and was asked to save it
- I clicked yes and got an error - Something like "Broken pipe"
- Then the backend crashed and wasn't reachable anymore

And now I can't even start it.
The last entry in the log file is this:
...
[05-Jan-2015 22:42:18.366] [DEBUG] Script Filter::SNMP added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script Filter::Agent added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script Filter::AgentOrSNMP added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script DCI::SampleTransform added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script Hook::ConfigurationPoll added to library


After the last loaded script there should be the newly created one. I assume it can't be loaded and crashes the server.
I already did a DB check, but no problem was found.

What can I do to fix that?
Any chance to remove it from the database?

Thanks, VMGuy
Title: Re: NetXMS 1.2.17 crashed and doesn't start anymore
Post by: tomaskir on January 06, 2015, 10:44:32 AM
In the database, go to the "script_library" table and change the script to "return true;".
Server should start now.

Was the script used in any Script DCIs or anywhere else?
Title: Re: NetXMS 1.2.17 crashed and doesn't start anymore
Post by: VMGuy on January 06, 2015, 02:17:32 PM
Thanks for the table name.
I removed this script from the table and now the server starts.

Thanks for that.

No the script wasn't used yet.
It should be a script for handling SNMP traps.
Title: Re: NetXMS 1.2.17 crashed and doesn't start anymore
Post by: Victor Kirhenshtein on January 07, 2015, 12:25:27 AM
Hi,

do you still have/remember source code of problematic script?

Best regards,
Victor
Title: Re: NetXMS 1.2.17 crashed and doesn't start anymore
Post by: VMGuy on January 07, 2015, 01:11:29 AM
It's still on my screen as result of the select statement before I deleted it.
It was a copy of a script I found in this forum and I started playing around with it.

|     10001 | Acronis_Backup_Trap     |
sub main() {
    switch($event->parameters[1]) {
      case "Unkown":
        evt = "ACRONIS_BACKUP_UNKOWN";
        break;
      case "Information"
        evt = "ACRONIS_BACKUP_INFO";
        break;
      case "Warning"
        evt = "ACRONIS_BACKUP_WARNING";
        break;
      case "Error"
        evt = "ACRONIS_BACKUP_ERROR";
        break;
      default:
        evt = "ACRONIS_BACKUP_INFO";
        break;
    }
    PostEvent($node, evt, null, $event->parameters[1]);  // pass message as first parameter to generated event
  } else {
    PostEvent($node, "ACRONIS_BACKUP_CLOSE");
  }
}