snmpd.conf pass All oid - oid

I have my snmpd.conf configured to pass a list of oids, and run a bash script subsequently. Everything is working fine. But what i want is to pass any oid without having to specify each one line by line. Any idea how to do it ?
Here is the snmpd.conf file

Related

load_file returns NULL in Mariadb without error. Where is the reason for this failure logged?

System information:
Linux Fedora 26
Mariadb version 10.1.25
I have executed all the statements as described in MariaDB Insert BLOB Image.
In addition I have also disabled selinux.
But load_file still returns NULL without giving an error.
I followed these instructions (https://mariadb.com/kb/en/the-mariadb-library/general-query-log/) to enable general logging but 'queries.log' only reports that the query has been executed without giving information on why it returns NULL instead of the wanted output.
Does Mariadb log the reason for this failure? If so, where?
Verify the rest of the constraints:
LOAD_FILE(file_name)
Reads the file and returns the file contents as a string. To use this function, the file must be located on the server host, you must specify the full path name to the file, and you must have the FILE privilege. The file must be readable by all and its size less than max_allowed_packet bytes. If the secure_file_priv system variable is set to a nonempty directory name, the file to be loaded must be located in that directory.
If the file does not exist or cannot be read because one of the preceding conditions is not satisfied, the function returns NULL.
The character_set_filesystem system variable controls interpretation of file names that are given as literal strings.
You need ALL directories in the path have SET executable bit

Is it possible to pass a space character to a cgi?

I have a compiled c binary (setch) which takes the parameters HIGH/LOW/OFF so I am trying to execute the command eg setch OFF from javascript/jquery thus:
$.get("cgi-bin/setch.cgi","OFF"); -or
$.get("cgi-bin/setch OFF");
As it's a get then the space is encoded into %20, of course. However the server then tries to execute the command setch%20OFF and returns:
404 Not Found
Without the parameter the program executes and returns my message:
no parameters
ie all paths, permissions etc are OK
Am I trying to do the impossible here? Or am I missing something in the server (lighttpd) config?
Thanks
You want to pass a parameter to a CGI. The way to do that is not to separate them with a space, instead you want to put the parameter behind a "?" character. The HTTP server will then store everything that follows behind the question mark in the QUERY_STRING environment variable that your CGI can then read.
I.e.
$.get("cgi-bin/setch?OFF");
In your C program use getenv("QUERY_STRING") to access the passed parameter.
Check https://en.wikipedia.org/wiki/Common_Gateway_Interface for a list of all environment variables that the HTTP server set for CGI programs. Be sure to treat the values as untrusted data.

nginx writre log to sqlite

please could you help me
can I let NGINX to write access log directly to sqlite table which I will make the same field as in access.log?
I know I can try to do it with LUA, but I do not know how to put the trigger to nginx to run LUA script on every record in access.log file
You would use the log_by_lua phase to write access logs, as it runs last and allows you to access variables like upstream_response_time, etc.

How to set -n (number of users ) for database server?

We have increased the -n parameter in broker/db.pf file.We restarted the server and when we check in promon its still showing the same number of users. How do we increase the -n parameter?
I know you answered this yourselves but for future users a real answer can be good. There are several ways to set parameters like -n. This answer really applies to changing all startup parameters (but not what values are "good").
How you change this value depends on how you start your database. See below.
NB 1: you should be aware of your licensing plan before changing this number and contact your sales contact if needed.
NB 2: you should be aware that changing startup parameters can affect performance etc. Test new values in a separate environment before moving them to production.
NB 3: backup all files before messing around...
Managed Database
A managed database is a database that is handled by the AdminServer. OE Management is not needed for this approach. A working installation of OE Explorer is however recommended.
The managed database is started (and stopped etc) via either the web based OE Explorer interface or the dbman command line utility.
Settings are stored in conmgr.properties under your Progress installation. You can edit this file manually (save a copy first...) or via the OE Explorer (recommended way).
You will have a line like this in the file:
maxusers=20 # -n
Edit the number to your liking with your favourite editor.
You can also change this in the OE Explorer:
Log in to OE Explorer. Default location is http://servername:9090/.
Locate and click on the database (if it's not there it's not handled by the adminserver - see below).
Select Configuration
Select Configuration (again, not "servergroup")
Click EDIT
-n (or Max users) is located in the first group of settings ("General"). See picture below.
Edit the value and don't forget to save.
Scripted Database
A scripted database is a database that started with a custom script (or also directly from command line). The actual startup could be handled by crontab, a user, the server generic startup script etc.
The OE AdminServer is not "aware" of this database. (You can make the AdminServer "a little" aware of it by running the dbagent command line utility with certain parameters. Read more about this in the manual).
You could generally divide into two ways of handling the script: with parameters in it or with parameters in a separate parameter file (often with the extension .pf).
Script with parameters in it
With this approach you store all parameters in the actual startup script.
proserve <dbname> -H <hostname> -S <serviceport> -n 10 -B 10000 -spin 10000 etc..
Script with a separate parameter file
With this approach you store the parameters in a separate file.
proserve <dbname> -pf /path/to/file/file.pf
The .pf-file can be formatted like the parameters in the command line:
-db <dbname> -H <hostname> -S <service> etc.
Or with newlines (this allows for comments in the file):
# Main database
-db <dbname>
-H <hostname>
-S <service>
You can also mix these two approaches.
Sources:
OE Management and OE Explorer
OE Database Management

biztalk putting the processed file into some folder

I have a requirement:
If I get a file, I am putting the content of that file into a database,
If there is any error in that file, I am putting it in an error folder.
Can I do something like this? Suppose I have a folder "processed" and another one "unprocessed". In case of an error, result will go in "unprocessed" and if there is no error it will go into "processed".
I don't know how to achieve that if biztalk processed some file then only put into some folder.
I suppose if I will put filter option BTS.ReceivePortName it will also put the error file into process folder.
It's very easy to create an extra send port that archives all input files.
If there's an error you just find the file, fix the issue, and re-drop it.
Create a send port, set up the filters to select the input you want (like BTS.ReceivePortName as you already know), use a pass through pipeline, then configure it as to write files. Write your files to a backup directory.
If you only want to catch errors then you will have to do extra setup. You must use an orchestration. Put a scope shape around your normal processing in the orchestration. Place an exception to catch errors on the scope shape. In the exception handler use a send shape to construct and write a copy of the original message to a send port. Add an expression to write some helpful message to the event log so you can debug the failure.

Resources