- Timestamp:
- 04/03/08 19:47:01 (5 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 9567d4b, eb30340
- Parents:
- b7ed6ac
- File:
-
- 1 edited
-
scripts/test.lua (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
scripts/test.lua
r8b206ee r367bf20 1 --require("luacom") 2 --require("luacom") 3 --require("luacom-lua5-13") 1 4 2 print('Loading test script...') 5 nscp.print('Loading test script...') 6 -- win = loadlib("win32.dll","luaopen_w32") 7 -- print(win) -- nil 8 require( 'w32' ) 9 nscp.print(w32) 10 nscp.print(w32.FindWindow) 3 11 4 register_command('check_something', 'something') 12 nscp.execute('version') 13 v = nscp.getSetting('NSCA Agent', 'interval', 'broken') 14 nscp.print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') 15 nscp.print('value: ' .. v) 16 nscp.print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') 17 18 nscp.register('check_something', 'something') 19 nscp.register('lua_debug', 'debug') 20 nscp.register('foo', 'something') 5 21 6 22 function something (command) 7 print(command) 8 code, msg, perf = inject('CheckCPU','time=5','MaxCrit=5') 23 nscp.print(command) 24 --code, msg, perf = inject('CheckCPU','time=5','MaxCrit=5') 25 msg = 'hello' 26 perf = 'hello' 27 code = 'ok' 9 28 print(code .. ': ' .. msg .. ', ' .. perf) 29 collectgarbage () 30 10 31 return code, 'hello from LUA: ' .. msg, perf 11 32 end 33 34 35 function debug (command, args) 36 table.foreachi(args, print) 37 print ('Command was: ' .. command) 38 return 'ok', 'hello' 39 end
Note: See TracChangeset
for help on using the changeset viewer.








