hello everybody!
I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(){
int fileDescriptor;
fileDescriptor =... (2 Replies)
i have two lines in my rc.local file that are
wget -O/<path>/<file>.zip url://domain.com
unzip -o /<path>/<file>.zip
the wget works fine, but the unzip won't work. when i copy/pase the unzip line to the prompt it works fine. i thought that maybe the unzip was running before the wget... (0 Replies)
Hi,
from the manual
listen(2): listen for connections on socket - Linux man page
It has a parameter called backlog and it limits the maximum length of queue of pending list.
If I set backlog to 128, is it means no more than 128 packets can be handled by server?
If I have three... (3 Replies)
Hello dear users, here I have a script to manipulate .csv files that are like this originally:
And I need to make a script to delete certain fields. Each field is separated with a comma.
So, here is my script (at least a part of it):
Field $1 is composed of a name, and then a... (5 Replies)
Hello,
can someone please help me to fix this script,
I have a 2 files, one file has hostname information and second file has console information of the hosts in each line, I have written a script which actually reads each line in hostname file and should grep in the console file and paste the... (8 Replies)
Hi
I need help with my coding , first time I'm working with bash .
What i must do is check if there is 3 .txt files if there is not 3 of them i must give an error code , if al three is there i must first arrange them in alphabetical order and then take the last word in al 3 of the .txt files... (1 Reply)
Hi,
I have the following requirement.
There will be following text/line in a file (eg: search-build.txt)
PRODUCT_VERSION="V:01.002.007.Build1234"
I need to update the incremental build number (eg here 007) every time I give a build through script. I am able to search the string and get... (4 Replies)
Hello,
I am not sure, where I am missing in the scirpt, I am trying to grep few users from /etc/passwd file and if exists, I added line to echo as user exist, if not create it.
#!/bin/bash
for vid in v707 z307 z496 z163 z292 ; do
if
then
echo " $vid User exists "
else
... (2 Replies)
Hi
I am setting the variables like this :
setenv MODULE1 modem5__3
setenv MODULE2 modem5__2
setenv MODULE3 modem_ctrl_1_1
setenv MODULE4 modem_1_0
setenv COUNT 10
I am having a bash script as shown below
################################################
#!/bin/bash
for ((... (5 Replies)
Hi
I keep getting the following error
sed: -e expression #1, char 32: unterminated `s' command
sed: -e expression #1, char 35: unterminated `s' command
sed: -e expression #1, char 35: unterminated `s' command
whenever I use the following bash script
#! /bin/bash... (2 Replies)
Discussion started by: spbr
2 Replies
LEARN ABOUT PHP
snmpset
SNMPSET(3) 1 SNMPSET(3)snmpset - Set the value of anSNMPobjectSYNOPSIS
bool snmpset (string $host, string $community, string $object_id, string $type, mixed $value, [int $timeout = 1000000], [int
$retries = 5])
DESCRIPTION snmpset(3) is used to set the value of an SNMP object specified by the $object_id.
PARAMETERS
o $host
- The hostname of the SNMP agent (server).
o $community
- The write community.
o $object_id
- The SNMP object id.
o $type
- The MIB defines the type of each object id. It has to be specified as a single character from the below list.
types
+--+--------------------------------+
|= | |
| | |
| | The type is taken from the MIB |
| | |
|i | |
| | |
| | INTEGER |
| | |
|u | |
| | |
| | INTEGER |
| | |
|s | |
| | |
| | STRING |
| | |
|x | |
| | |
| | HEX STRING |
| | |
|d | |
| | |
| | DECIMAL STRING |
| | |
|n | |
| | |
| | NULLOBJ |
| | |
|o | |
| | |
| | OBJID |
| | |
|t | |
| | |
| | TIMETICKS |
| | |
|a | |
| | |
| | IPADDRESS |
| | |
|b | |
| | |
| | BITS |
| | |
+--+--------------------------------+
If OPAQUE_SPECIAL_TYPES was defined while compiling the SNMP library, the following are also valid:
types
+--+----------------+
|U | |
| | |
| | unsigned int64 |
| | |
|I | |
| | |
| | signed int64 |
| | |
|F | |
| | |
| | float |
| | |
|D | |
| | |
| | double |
| | |
+--+----------------+
Most of these will use the obvious corresponding ASN.1 type. 's', 'x', 'd' and 'b' are all different ways of specifying an OCTET
STRING value, and the 'u' unsigned type is also used for handling Gauge32 values. If the MIB-Files are loaded by into the MIB Tree
with "snmp_read_mib" or by specifying it in the libsnmp config, '=' may be used as the $type parameter for all object ids as the
type can then be automatically read from the MIB. Note that there are two ways to set a variable of the type BITS like e.g. "SYNTAX
BITS {telnet(0), ftp(1), http(2), icmp(3), snmp(4), ssh(5), https(6)}":
o Using type "b" and a list of bit numbers. This method is not recommended since GET query for the same OID would return e.g.
0xF8.
o Using type "x" and a hex number but without(!) the usual "0x" prefix.
See examples section for more details.
o $value
- The new value.
o $timeout
- The number of microseconds until the first timeout.
o $retries
- The number of times to retry if timeouts occur.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
If the SNMP host rejects the data type, an E_WARNING message like "Warning: Error in packet. Reason: (badValue) The value given has the
wrong type or length." is shown. If an unknown or invalid OID is specified the warning probably reads "Could not add variable".
EXAMPLES
Example #1
Using snmpset(3)
<?php
snmpset("localhost", "public", "IF-MIB::ifAlias.3", "s", "foo");
?>
Example #2
Using snmpset(3) for setting BITS SNMP object id
<?php
snmpset("localhost", "public", 'FOO-MIB::bar.42', 'b', '0 1 2 3 4');
// or
snmpset("localhost", "public", 'FOO-MIB::bar.42', 'x', 'F0');
?>
SEE ALSO snmpget(3).
PHP Documentation Group SNMPSET(3)